special-characters

iconv returns strange results

微笑、不失礼 提交于 2019-12-24 01:53:36
问题 I'm working on a way to solve the problem with special characters in an automated script for creating accounts in PHP. Since special characters are unwanted in email addresses and other places I'm trying to get rid of them, but I can't remove them before feeding them to the script since the users name has to be displayed properly to other users. Example: Jörgen Götz should get the email address jorgen.gotz@domain.com but in the user database his first name should still be Jörgen and his last

How do I write the Multiplication Sign in reStructuredText (reST)?

荒凉一梦 提交于 2019-12-24 00:50:10
问题 I'm writing reST documents that will be rendered to HTML and PDF using Sphinx. My source files are UTF-8, and expect my HTML to be displayed as UTF-8. What's the best practice for writing the multiplication sign? That is: ×, not x. I know I can insert it as a Unicode character. If I were writing LaTeX, I'd use \times . In HTML there's × . Is the simple Unicode going to properly survive the conversion process when I render everything with Sphinx? Even if I render to other more exotic formats?

Using mod_rewrite with chinese characters in Apache

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 00:47:44
问题 I am having trouble finding information on Apache mod_rewriting using Chinese characters (all the info I can find relates to numbers). I want to rewrite /character.php?character=宠 (where the character is the result of a search and thus will vary) to /character/宠 . This is my (poor) attempt: RewriteRule ^character/?$ characters?character=$1 [NC,L] I would appreciate any help. Thanks, Dan 回答1: First of all, your Regular Expression is incorrect. Using the ? tells mod_rewrite that the character

Creating XML in PHP using SimpleXML with special characters

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 00:46:51
问题 I am working on project in flex 3 , where user enters some text which is to be stored in a mysql database and shown later. I am using XML for data transfer from flex to php and vice-versa. SimpleXMLElement in php is being used to create the XML . The problem is the XML breaks on special characters. Here is sample code: FLEX: var someXML:XML = <root><data>somedata</data><data>...</data> ... </root> var data:Object = {}; data.xmlData = someXML; saveDataService.send(data); Here somedata is the

Is there a way to run an insert into statement with a valid “?” in it?

試著忘記壹切 提交于 2019-12-24 00:26:10
问题 I am trying to build an insert into statement that will include a URL string which has a valid "?" in it. I am using Teradata SQL Assistant (Windows XP) and it is trying to translate this into a parameter. Is there any way to override this and treat it as a character value? Example URL: https://www.location.com/livelink.exe?func=ll 回答1: Go to the Query tab on the Tools -> Options... page and uncheck the box labeled "Allow use of Named Parameters in queries". Here are the settings I use: That

Does the XML specification states that parser need to convert \n\r to \n always, even when \n\r appears in a CDATA section?

陌路散爱 提交于 2019-12-23 23:00:12
问题 I've stumbled in a problem handling the \line-feed and \carriage-return characters in xml. I know that, according to http://www.w3.org/TR/REC-xml/#sec-line-ends, xml processors are required to replace any "\n\r" or lone "\r" sequences with "\n". The specification states that this has to be the behaviour for handling any "external parsed entity", does this apply to CDATA sections inside of an element as well? thank you, Michele I'm sure that msxml library for example converts every \n\r" or

removing emojis from a string in Python

扶醉桌前 提交于 2019-12-23 20:25:08
问题 I found this code in Python for removing emojis but it is not working. Can you help with other codes or fix to this? I have observed all my emjois start with \xf but when I try to search for str.startswith("\xf") I get invalid character error. emoji_pattern = r'/[x{1F601}-x{1F64F}]/u' re.sub(emoji_pattern, '', word) Here's the error: Traceback (most recent call last): File "test.py", line 52, in <module> re.sub(emoji_pattern,'',word) File "/usr/lib/python2.7/re.py", line 151, in sub return

Reserved characters in PHP $_SESSION variable keys

你离开我真会死。 提交于 2019-12-23 20:06:21
问题 I was looking at the internal representation of PHP session file and I noticed that the session keys are separated by the pipe character | . Before getting into the problem I encountered, let me give a quick tutorial on how the session file is formatted. At least, this is how it was formatted on my Mac (10.9.4, PHP 5.4.24). Session File Format Say I have the following code: $_SESSION["age"] = 26; $_SESSION["car"] = "Mazda"; $_SESSION["nerdy"] = true; $_SESSION["likes"] = array(42, "being meta

what is the symbol that looks like space, but not a space? (not a  )

妖精的绣舞 提交于 2019-12-23 16:55:04
问题 I'm talking NOT about   but about another symbol " " that looks like " " even in text area, but that's another symbol (splitting the string by space symbol does NOT split "hello world" into two words). 回答1:   or one of those below maybe? http://www.w3.org/TR/html4/sgml/entities.html <!-- General Punctuation --> <!ENTITY ensp CDATA " " -- en space, U+2002 ISOpub --> <!ENTITY emsp CDATA " " -- em space, U+2003 ISOpub --> <!ENTITY thinsp CDATA " " -- thin space, U+2009 ISOpub --> 回答2: in the old

How to encode special characters for a POST with Spring/Roo

穿精又带淫゛_ 提交于 2019-12-23 15:48:42
问题 I'm using Spring/Roo for an app server, and need to be able to post some special characters. Specifically, characters like the Yen symbol, or Euro symbol. When I receive these characters on my server, and display them in console, they appear as "?". How can they be properly encoded and received? 回答1: There are a couple of possible failure points here. First, I'd check to see if the console supports the characters in question: if the default encoding used by the JVM does not support the