special-characters

How to set the “Content-Type … charset” in the request header using a HTML link

白昼怎懂夜的黑 提交于 2019-12-01 02:18:05
I have a simple HTML-page with a UTF-8 encoded link. <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <a charset='UTF-8' href='http://server/search?q=%C3%BC'>search for "ü"</a> </body> </html> However, I don't get the browser to include Content-Type:application/x-www-form-urlencoded; charset=utf-8 into the request header. Therefore I have to configure the webserver to assume all requests are UTF-8 encoded (URIEncoding="UTF-8" in Tomcat server.xml). But of course the admin won't let me do that in the production environment (Websphere). I know it's

Hyphen vs Dash : Replace Dash with Hyphen

时光毁灭记忆、已成空白 提交于 2019-12-01 01:41:52
问题 Alright so we had a problem recently In reporting services some of the String Columns were appearing as gibberish Chinese characters. On further investigation we found it is the hyphen. Well that's what we though first. On further investigation we found it a dash (or en dash) . Basically the reason this has happened is people copy pasting values into this column from word which converts hyphens into dashes automatically. But if you look at the database they both look the same. Though on the

How to set the “Content-Type … charset” in the request header using a HTML link

旧城冷巷雨未停 提交于 2019-11-30 21:47:42
问题 I have a simple HTML-page with a UTF-8 encoded link. <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <a charset='UTF-8' href='http://server/search?q=%C3%BC'>search for "ü"</a> </body> </html> However, I don't get the browser to include Content-Type:application/x-www-form-urlencoded; charset=utf-8 into the request header. Therefore I have to configure the webserver to assume all requests are UTF-8 encoded (URIEncoding="UTF-8" in Tomcat server

Json file to powershell and back to json file

£可爱£侵袭症+ 提交于 2019-11-30 21:44:36
I am trying to manipulate json file data in powershell and write it back to the file. Even before the manipulation, when I just read from the file, convert it to Json object in powershell and write it back to the file, some characters are being replaced by some codes. Following is my code: $jsonFileData = Get-Content $jsonFileLocation $jsonObject = $jsonFileData | ConvertFrom-Json ... (Modify jsonObject) # Commented out this code to write back the same object $jsonFileDataToWrite = $jsonObject | ConvertTo-Json $jsonFileDataToWrite | Out-File $jsonFileLocation Some characters are being replaced

Convert special characters to HTML character codes

我的未来我决定 提交于 2019-11-30 20:45:50
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? 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"), "\n";' ®ç If you're not using unicode, omit the charset name or give the correct charset. The easiest would

Sending a string containing special characters through a TcpClient (byte[])

强颜欢笑 提交于 2019-11-30 20:25:27
I'm trying to send a string containing special characters through a TcpClient (byte[]). Here's an example: Client enters "amé" in a textbox Client converts string to byte[] using a certain encoding (I've tried all the predefined ones plus some like "iso-8859-1") Client sends byte[] through TCP Server receives and outputs the string reconverted with the same encoding (to a listbox) Edit : I forgot to mention that the resulting string was "am?". Edit-2 (as requested, here's some code): @DJKRAZE here's a bit of code : byte[] buffer = Encoding.ASCII.GetBytes("amé"); (TcpClient)server.Client.Send

Checking if a character is a special character in Java [duplicate]

非 Y 不嫁゛ 提交于 2019-11-30 15:26:47
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: JAVA: check a string if there is a special character in it I am a novice programmer and am looking for help determining if a character is a special character. My program asks the user to input the name of a file, and the program reads the text in the file and determines how many blanks spaces, digits, letters, and special characters are in the text. I have the code completed to determine the blanks, digits, and

Spanish Characters not Displaying Correctly

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 15:12:52
问题 I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> I have also made sure that the page header is set for utf-8 also: header('Content-type: text/html; charset=UTF-8'); Here is the beginning stages of my code thus far: <?php setlocale(LC_ALL, 'es_MX'); $datetime = strtotime($event['datetime']); $date = date("M j, Y",

Replace special characters before the file is uploaded using PHP

三世轮回 提交于 2019-11-30 14:44:35
问题 I was wondering if it is possible to change the name of the file to be uploaded. I mean what I am trying to do is that, the user uploads a file which may have some special characters like special characters in some European languages. What I am planning to do is that before using the move_uploaded_file command is it possible to change/preg_replace the special characters with normal characters, so that the file is uploaded and stored with the new name which has only normal characters. 回答1: //

How do I find information on bash special parameters ($* $@ $# $? $- $$ $! $0 $_)? [duplicate]

假如想象 提交于 2019-11-30 14:17:27
This question already has an answer here: What are the special dollar sign shell variables? 4 answers (I've seen a number of questions here about Bash special parameters. It can be difficult to search for things like $* , both in the Bash manual and via Google. This question is intended to be a general reference for these questions.) The Bash shell defines a number of "special parameters" (which is itself a bit confusing, since most of us think of them as "variables", not "parameters"). References to them consist of a dollar sign followed by some punctuation character. Google searches for