special-characters

Objective-C: How to replace HTML entities? [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-11-27 04:32:13
This question already has an answer here: Objective C HTML escape/unescape 14 answers I'm getting text from Internet and it contains html entities (i.e. ó = ó). I want to show this text into a custom iPhone cell. I've tried to use a UIWebView into my custom cell but I prefer to use a multiline UILabel. The problem is I can't find any way of replacing these HTML entities. Check out my NSString category for HTML . Here are the methods available: - (NSString *)stringByConvertingHTMLToPlainText; - (NSString *)stringByDecodingHTMLEntities; - (NSString *)stringByEncodingHTMLEntities; - (NSString *

Android: Unicode/Charset problems when sending an SMS (sendTextMessage)

a 夏天 提交于 2019-11-27 04:26:47
Basically I have a working application that sends an SMS after receiving an SMS. Everything works fine , except when the SMS text to send has "special chars", ie "é,à,í,ç", etc. I've tried many things including charset conversion but I simply can't make it work... the msgText always comes back with charset encoding problems. Here's the part where the message is sent: if (msgText.length() > 160) { ArrayList msgTexts = sm.divideMessage(msgText); sm.sendMultipartTextMessage(PhoneNumber, null, msgTexts, null, null); } else { try { sm.sendTextMessage(PhoneNumber, null, msgText, null, null); } catch

single quotes escape during string insertion into a database

♀尐吖头ヾ 提交于 2019-11-27 04:23:21
问题 Insertion fails when "'" is used. example string is: He's is a boy. I've attempted to skip the "'" using an escape symbol , but I believe this is not the right way. textBox3.Text.Replace("'", " \'"); string sql= "insert into gtable (1text,1memo) values ('"+textBox3.Text+"',null)"; OleDbCommand cmd = new OleDbCommand(sql, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); I did have the option of replacing "'" with "`" but this changes the text in the db as well. I wish to retain "'" as the

Change foreign characters to their normal equivalent

江枫思渺然 提交于 2019-11-27 04:03:00
I am using php and I was wondering if there was a predefined way to convert foreign characters to their non-foreign alternatives. Characters such as ê, ë, é all resulting to 'e' . I'm looking for a function that would take a string and return it without the special characters. Any ideas would be greatly appreciated! Edgar Zagórski After failing to find suitable convertors I created my own collection that suits my needs including my favorite Cyrillic conversion that by default has numerous variations. function transliterateString($txt) { $transliterationTable = array('á' => 'a', 'Á' => 'A', 'à'

Meaning of $? (dollar question mark) in shell scripts

拜拜、爱过 提交于 2019-11-27 02:41:09
What does echo $? mean in shell programming? This is the exit status of the last executed command. For example the command true always returns a status of 0 and false always returns a status of 1 : true echo $? # echoes 0 false echo $? # echoes 1 From the manual: (acessible by calling man bash in your shell) $? Expands to the exit status of the most recently executed foreground pipeline. By convention an exit status of 0 means success, and non-zero return status means failure. Learn more about exit statuses on wikipedia . There are other special variables like this, as you can see on this

Problems reading CSV file with commas and characters in pandas

大憨熊 提交于 2019-11-27 02:24:32
问题 I am trying to read a csv file using pandas and the file has a column called Tags which consist of user provided tags and has tags like - , "", '',1950's, 16th-century. Since these are user provided, there are many special characters which are entered by mistake as well. The issue is that I cannot open the csv file using pandas read_csv. It shows error:Cparser, error tokenizing data. Can someone help me with reading the csv file into pandas? 回答1: Okay. Starting from a badly formatted CSV we

PHP: Dealing special characters with iconv

心已入冬 提交于 2019-11-27 01:46:53
问题 I still don't understand how iconv works. For instance, $string = "Löic & René"; $output = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $string); I get, Notice: iconv() [function.iconv]: Detected an illegal character in input string in... $string = "Löic"; or $string = "René"; I get, Notice: iconv() [function.iconv]: Detected an incomplete multibyte character in input string in. I get nothing with $string = "&"; There are two sets of different outputs I need store them in the two different columns

What are the allowed characters in a subdomain?

依然范特西╮ 提交于 2019-11-27 01:39:02
What characters are you allowed to use in a subdomain? Example: for someSub.example.com the someSub portion. I know you can use letters, numbers, and hyphens, but what about other characters? Can _ (underscore) be used? William Dwyer Letters (except stressed à), Numbers 0-9 and Hyphen. http://en.wikipedia.org/wiki/Domain_name excerpt: Valid characters that can be used in a domain name are: a-z 0-9 - but not as a starting or ending character . as a separator for the textual portions of a domain name From http://tools.ietf.org/html/rfc1035 Various objects and parameters in the DNS have size

Does At symbol (@) and Dollar Sign ($) has any special meaning in C or C++

匆匆过客 提交于 2019-11-27 01:31:50
问题 Recently one of my friend encountered this question in an interview. The interviewer asked him if the special characters like $, @, |, ^, ~ have any usage in c or c++ and where. I know that |, ^ and ~ are used as Bitwise OR, XOR and Complement respectively. But I don't know if @ and $ has any special meaning. If it does, could you please give example where it can be applied? 回答1: @ is generally invalid in C; it is not used for anything. It is used for various purposes by Objective-C, but that

Android default charset when sending http post/put - Problems with special characters

我们两清 提交于 2019-11-27 00:56:58
问题 I have configured the apache httpClient like so: HttpProtocolParams.setContentCharset(httpParameters, "UTF-8"); HttpProtocolParams.setHttpElementCharset(httpParameters, "UTF-8"); I also include the http header "Content-Type: application/json; charset=UTF-8" for all http post and put requests. I am trying to send http post/put requests with a json body that contains special characters (ie. chinese characters via the Google Pinyin keyboard, symbols, etc.) The characters appear as gibberish in