special-characters

NSURL URLWithString: is null with non-english accented characters

隐身守侯 提交于 2019-11-27 00:36:52
I have the following string... NSString *googleSearchString = @"http://www.google.com/search?q=lyrics+%22Tænder+På+Dig%22+%22Jakob+Sveistrup%22"; Notice that it has some accented characters. When I try to turn that into a url the returned url is null... [NSURL URLWithString:googleSearchString]; So normally the url works except when there are accented non-english characters in the string. Any help on how to handle that? You need to escape the special characters to make it work properly. Something like: [NSURL URLWithString:[googlSearchString stringByAddingPercentEscapesUsingEncoding:

php mail special characters utf8

蹲街弑〆低调 提交于 2019-11-26 23:03:40
I have the following script: <?php $subject = "Testmail — Special Characters"; $msg = "Hi there,\n\nthis isn’t something easy.\n\nI haven’t thought that it’s that complicated!"; mail($to,$subject,$msg,$from."\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"); ?> In the e-mail: Subject: Testmail ? Special Characters Body: Hi there, this isn?t something easy. I haven?t thought that it?s that complicated! I tried a lot of things, but I have no ideas anymore. Can you help me? Did you ever got this working? THX! Did you try iconv_set_encoding ? This should work : <?php

Is there a HTML/CSS way to display HTML tags without parsing?

对着背影说爱祢 提交于 2019-11-26 23:01:23
问题 Is there any way that I could display HTML tags without parsing? Tags like XMP worked before perfectly but now it's replaced with PRE that isn't so cool. Take a look at this example: //This used to NOT PARSE HTML even if you used standard < and >. <XMP> <a hred="http://example.com">Link</a> </XMP> //New PRE tag requires < and > as replacement for < and >. <PRE> <a href="http://example.com">Link</A> </PRE> What I'm looking for is equivalent of old XMP tag. New PRE tag will parse code. 回答1: You

Which are the HTML, and XML, special characters?

a 夏天 提交于 2019-11-26 22:16:56
问题 What are the special reserved character entities in HTML and in XML? The information that i have says: HTML: & (replace with & ) < (replace with < ) > (replace with > ) " (replace with " ) ' (replace with &apos; ) XML: < (replace with < ) > (replace with > ) & (replace with & ) ' (replace with &apos; ) " (replace with " ) But i cannot find documentation on either of these. The W3C does mention, in Extensible Markup Language (XML) 1.0 (Fifth Edition), certain predefined entity references. But

Is a colon `:` safe for friendly-URL use?

こ雲淡風輕ζ 提交于 2019-11-26 21:38:01
We are designing a URL system that will specify application sections as words separated by slashes. Specifically, this is in GWT, so the relevant parts of the URL will be in the hash (which will be interpreted by a controller layer on the client-side): http://site/gwturl#section1/section2 Some sections may need additional attributes, which we'd like to specify with a : , so that the section parts of the URL are unambiguous. The code would split first on / , then on : , like this: http://site/gwturl#user:45/comments Of course, we are doing this for url-friendliness, so we'd like to make sure

How to find special characters in DB2?

佐手、 提交于 2019-11-26 21:22:44
问题 I have a DB2 database containing millions of records. I found that some char() or varchar() fields contain special characters which shouldn't be stored. I guess application received broken data or some code made it. Anyway, I want to find records that have these broken data, which are special characters (not alphabetic). I tried to find the way using query but couldn't. Does someone know the good query or advice? 回答1: You can use the DB2 TRANSLATE() function to isolate non-alphanumeric

How to escape literal percent sign when NO_BACKSLASH_ESCAPES option is enabled?

為{幸葍}努か 提交于 2019-11-26 20:39:46
My company runs MySQL in NO_BACKSLASH_ESCAPES mode. How can I escape a literal % or _ in a LIKE query in this mode? The standard way is \% , but that doesn't work in this mode. Example: a column has the following values: 5% off , 50% off . The following query works in standard mode but not in NO_BACKSLASH_ESCAPES mode: SELECT * FROM mytable WHERE mycol LIKE '5\% off' ajreal you need escape select * from mytable where mycol like '5\% off' escape '\'; For a version that works regardless of NO_BACKSLASH_ESCAPES mode, you can use a different character, like pipe: select * from mytable where mycol

UTF-8 encoded html pages show � (questions marks) instead of characters

狂风中的少年 提交于 2019-11-26 18:54:55
I have the standard XAMPP installation on win7 (x64). Having had my share of encoding troubles in a past project where mysql encoding did not match with the php enconding which in turn sometimes output html in other encodings, I decided to consistently encode everything using utf-8. I'm just getting started with the html markup and am allready experiencing troubles. My page is saved using utf-8 (no BOM, I think ) //update: It turns out this was NOT the case. The file was actually saved with ISO_8859-1 . I later found this out thanks to Sherm Pendleys answer. I had to go back and change my

Working with GD ( imagettftext() ) and UTF-8 characters

Deadly 提交于 2019-11-26 18:35:13
问题 Just for the record - my first question here but hopefully not my last input in the community. But that's not why I'm here. I'm currently developing a simple system that has to generate an image with a text on it. Everthing went well until I realised that GD cannot handle UTF-8 characters like ā, č, ž, ä, ø, é and so on. To clear things up - I'm using imagettftext() Trying to solve my problem I dug into depths of google and some solutions were returned, none of them, sadly, solved my problem

json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT

我是研究僧i 提交于 2019-11-26 18:34:18
问题 I have an annoying problem with a database query to mssql. If the result contains special characters like the german 'ä', I cannot use json_encode to get the result as json correctly. json_last_error return 5 which is equal to JSON_ERROR_UTF8 . I guess the database does not return the values as UTF-8 encoded. The database collection is *Latin1_General_CI_AS* and the affected columns are varchars . The php mssql.charset configuration has no effect. I read that mysql users could use mysql_query