special-characters

Unicode class names in C# - why do some work, when others don't?

两盒软妹~` 提交于 2019-12-30 18:20:33
问题 I'm wondering why this is. I have two unicode characters from the same group Ll, which is allowed according to the specs: http://msdn.microsoft.com/en-us/library/aa664670%28VS.71%29.aspx One of them works, the other gives a compile error, and I can't find any documentation on why this is: This works: U+0467 CYRILLIC SMALL LETTER LITTLE YUS ѧ This don't: U+04FF CYRILLIC SMALL LETTER HA WITH STROKE ӿ Can you help me find the pattern? 回答1: U+0467 is from Unicode 1.1, whereas U+04FF is from

Special character validation using JavaScript

a 夏天 提交于 2019-12-30 11:15:15
问题 Special characters < , > , % , '' , "" , $ and ^ are not allowed in a textbox. I need to put a validation check to restrict these characters on submit along with the null check. I wrote entire validation code in a function and calling it on click of the submit button, but the function is not recognised on click. Please help me write some JavaScript code to achieve this functionality. 回答1: A much simpler way is to use indexOf in javascript, function isSpclChar(){ var iChars = "!@#$%^&*()+=-[]\

What is the best way to remove punctuation marks, symbols, diacritics, special characters?

雨燕双飞 提交于 2019-12-30 07:59:09
问题 I use these lines of code to remove all punctuation marks, symbols, etc as you can see them in the array, $pattern_page = array("+",",",".","-","'","\"","&","!","?",":",";","#","~","=","/","$","£","^","(",")","_","<",">"); $pg_url = str_replace($pattern_page, ' ', strtolower($pg_url)); but I want to make it simpler as it looks silly to list all the stuff I want to remove in the array as there might be some other special characters I want to remove. I thought of using the regular expression

Convert special characters to HTML character codes

自古美人都是妖i 提交于 2019-12-30 06:39:14
问题 I'm developing a CMS for a customer and he needs to edit stuff and use special characters such as ç and ® . However, I don't want him to have to enter the character codes like ® . Does anyone knows a good way to automatically convert those characters using PHP? 回答1: You can use htmlentities() to do that. php -r 'echo htmlentities("®ç", ENT_COMPAT, "UTF-8"), "\n";' ®ç To turn entities back to readable text, use html_entity_decode(): php -r 'echo html_entity_decode("®ç", ENT_COMPAT, "UTF-8"), "

What's the difference between \n and \r\n?

给你一囗甜甜゛ 提交于 2019-12-29 04:33:49
问题 They both mean "new line" but when is one used over the other? 回答1: \r\n is a Windows Style \n is a POSIX Style \r is a old pre-OS X Macs Style, Modern Mac's using POSIX Style. \r is a carrige return and \n is a line feed, in old computers where it not have monitor, have only printer to get out programs result to user, if you want get printing from staring of new line from left, you must get \n for Line Feed , and \r for get Carriage return to the most left position, this is from old

Java replaceAll() regex does not work [duplicate]

心不动则不痛 提交于 2019-12-28 07:07:06
问题 This question already has answers here : String replace method is not replacing characters (5 answers) Closed last year . I'm trying to replace all special characters with a "%", like: "123.456/789" -> "123%465%798" my regular expression is: [^a-zA-Z0-9]+ In online tools* it works perfecly, but in java s.replaceAll("[^a-zA-Z0-9]+", "%"); strings remain untouched. *I tried: http://www.regexplanet.com/ http://regex101.com/ and others 回答1: Strings are immutable. You forgot to reassign new String

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

喜夏-厌秋 提交于 2019-12-28 02:04:24
问题 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,

PHP - Convert ΓÇô to dash

孤街醉人 提交于 2019-12-27 00:56:30
问题 I found some special characters in my PHP script. One of them is ΓÇô . It's actually a special character of a dash - . How should I convert it back to dash so I can process the string? 回答1: I found the answer! It's inspired by this answer $title = "Hunting, Tactical & Outdoor Optics eCommerce Store ΓÇô $595,000 ΓÇö SOLD"; $title = str_replace(html_entity_decode('–', ENT_COMPAT, 'UTF-8'), '-', $title); $title = str_replace(html_entity_decode('—', ENT_COMPAT, 'UTF-8'), '-', $title); Replacing

How to remove unknown line break (special character) in text file?

懵懂的女人 提交于 2019-12-25 21:29:17
问题 I have a text file which shows a Line Break in UltraEdit if we replace a special character in text file manually it works fine. Unknown Line Break. I have to change it manually and then process the files. Please let me know some way how to remove all occurrences of this character with VB.Net code. If I replace ♀ in UltraEdit, it replaces line break with my desired string. But in my VB string I cannot use this character or line break . 回答1: The character you have in your file is the form-feed

How to remove unknown line break (special character) in text file?

心不动则不痛 提交于 2019-12-25 21:29:12
问题 I have a text file which shows a Line Break in UltraEdit if we replace a special character in text file manually it works fine. Unknown Line Break. I have to change it manually and then process the files. Please let me know some way how to remove all occurrences of this character with VB.Net code. If I replace ♀ in UltraEdit, it replaces line break with my desired string. But in my VB string I cannot use this character or line break . 回答1: The character you have in your file is the form-feed