character-encoding

How to convert Platform::String to char*?

允我心安 提交于 2020-01-09 03:49:27
问题 How do I convert the contents of a Platform::String to be used by functions that expect a char* based string? I'm assuming WinRT provides helper functions for this but I just can't find them. Thanks! 回答1: Platform::String::Data() will return a wchar_t const* pointing to the contents of the string (similar to std::wstring::c_str() ). Platform::String represents an immutable string, so there's no accessor to get a wchar_t* . You'll need to copy its contents, e.g. into a std::wstring , to make

PHP decoding and encoding json with unicode characters

本小妞迷上赌 提交于 2020-01-08 17:13:26
问题 I have some json I need to decode, alter and then encode without messing up any characters. If I have a unicode character in a json string it will not decode. I'm not sure why since json.org says a string can contain: any-Unicode-character- except-"-or-\-or- control-character . But it doesn't work in python either. {"Tag":"Odómetro"} I can use utf8_encode which will allow the string to be decoded with json_decode, however the character gets mangled into something else. This is the result from

What encoding type of these text?

做~自己de王妃 提交于 2020-01-07 09:03:08
问题 When I search in Google by Thai language. Google will convert like these. %E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2 回答1: URL Encoding: See http://www.w3schools.com/tags/ref_urlencode.asp It's a URL encoding in which all non-alphanumeric characters except -_. are replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application

What encoding type of these text?

情到浓时终转凉″ 提交于 2020-01-07 09:02:15
问题 When I search in Google by Thai language. Google will convert like these. %E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2 回答1: URL Encoding: See http://www.w3schools.com/tags/ref_urlencode.asp It's a URL encoding in which all non-alphanumeric characters except -_. are replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application

Multibyte characters in URL are not rendering

不想你离开。 提交于 2020-01-07 06:44:13
问题 I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. -> � I thought it had to do with the charset which is used but i've tried both UTF-8 and iso-8859-1. Both without luck. I need to have the correct character in the url for the readability of deeplinks. 回答1: does the character U

Python encoding unicode utf-8

房东的猫 提交于 2020-01-07 04:53:06
问题 I'm using selenium to insert text input with german umlauts in a web formular. The declared coding for the python script is utf-8. The page uses utf-8 encoding. When i definine a string like that everything works fine: q = u"Hällö" #type(q) returns unicode ... textbox.send_keys(q) But when i try to read from a config file using ConfigParser (or another kind of file) i get malformed output in the webformular ( Hällö ). This is the code i use for that: the_encoding = chardet.detect(q)[

why in remote server cannot input Chinese character in mysql command line but local is ok

拜拜、爱过 提交于 2020-01-07 03:45:51
问题 In my local machine(Mac OS) iTerm2 terminal, I could login remote mysql server and input Chinese character successfully ➜ ~ mysql -h remote_ip -u username -p foo --safe-updates mysql> select '你好'; +--------+ | 你好 | +--------+ | 你好 | +--------+ 1 row in set (0.01 sec) then I login a remote server by ssh ➜ ~ ssh root@remote_ip and login the same mysql server root@qa-web:~# mysql -h remote_ip -u username -p foo --safe-updates mysql> select ' but this time I cannot input Chinese character in

Reading Lines and byte[] from input stream

放肆的年华 提交于 2020-01-07 03:04:49
问题 I have a network socket which recieves the following types of messages: (about 24 per second) Commands EG: [Pos,1,2,3,4,1,2,3,4]\n Images: [IMG,36000]\nbyte[36000] (byte[36000] is an array of 36000 bytes) So I would need an Reader for that stream that is able to read lines and byte[]. The problem is, that the BufferedReader converts the charset, which is very, very, very bad for images, so reading a string and converting it to byte seems not to be an option. I tried to connect a

fql query character encoding

大兔子大兔子 提交于 2020-01-06 20:01:30
问题 I am executing a FQL query, and if I print the array with the results I get wrong characters. For example instead of ò I get ò. my webpage is set to: text/html; charset=ISO-8859-1 I think it's an issue with facebook and not with me.. Have you experienced something similar and did you manage to solve it? 回答1: The results from Facebook are in UTF-8 encoding. ò character is c3b2 in UTF-8 (hex) 0xC3 - à 0xB2 - ² To convert the results to ISO-8859-1 from UTF-8 in PHP you may use utf8_decode

Charset in XML output from SQL .. german characters .. where am I going wrong?

微笑、不失礼 提交于 2020-01-06 19:53:15
问题 Thanks for taking the time! I am trying to put together a mapping app to experiment with the Google Maps V3 API. It is also my first time outputting XML with PHP/SQL and then processing the results. I am using this as my guide >> http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html My problem is when I use a SQL table containing German addresses/characters, it doesn't work -- I get this error thrown to me This page contains the following errors: error on line 2 at column 1: Extra