character-encoding

Sending arabic characters in URL

前提是你 提交于 2020-01-12 09:56:09
问题 i have these arabic sentence: نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي It must be sent in the url. I tried this approach: $url = 'http://example.com/?q='.urlencode('نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي'); The result of that encoding is: %D9%86%D8%A7%D9%8A%D8%AA%D9%8A%D8%AF+%D8%A3%D9%85%D8%A7%D9%85%D9%87+%D8%B9%D8%B4%D8%B1%D8%A9+%D8%A3%D9%8A%D8%A7%D9%85+%D9%81%D9%82%D8%B7+%D9%84%D9%83%D9%8A+%D9%8A%D9%82%D8%B1%D8%B1+%D9%85%D8%B3%D8%AA%D9%82%D8%A8%D9

Sending arabic characters in URL

末鹿安然 提交于 2020-01-12 09:55:29
问题 i have these arabic sentence: نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي It must be sent in the url. I tried this approach: $url = 'http://example.com/?q='.urlencode('نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي'); The result of that encoding is: %D9%86%D8%A7%D9%8A%D8%AA%D9%8A%D8%AF+%D8%A3%D9%85%D8%A7%D9%85%D9%87+%D8%B9%D8%B4%D8%B1%D8%A9+%D8%A3%D9%8A%D8%A7%D9%85+%D9%81%D9%82%D8%B7+%D9%84%D9%83%D9%8A+%D9%8A%D9%82%D8%B1%D8%B1+%D9%85%D8%B3%D8%AA%D9%82%D8%A8%D9

PHP string to hex

牧云@^-^@ 提交于 2020-01-12 08:00:15
问题 I have a string like that: [0-9A-Za-z\+/=]* How can I converted in the following form: "\133\x30\55\x39\101\x2d\132\x61\55\x7a\134\x2b\57\x3d\135\x2a" Is there any function for that ? 回答1: function strtohex($string) { $string = str_split($string); foreach($string as &$char) $char = "\x".dechex(ord($char)); return implode('',$string); } print strtohex("[0-9A-Za-z\+/=]*"); The above code will give you \x5b\x30\x2d\x39\x41\x2d\x5a\x61\x2d\x7a\x5c\x2b\x2f\x3d\x5d\x2a I'm aware that it doesn't

A form was submitted in the windows-1252 encoding

柔情痞子 提交于 2020-01-12 07:44:31
问题 I am getting the following warning in the JS tab of the Firefox web console ( Ctrl + Shift + K ) A form was submitted in the windows-1252 encoding which cannot encode all Unicode characters, so user input may get corrupted. To avoid this problem, the page should be changed so that the form is submitted in the UTF-8 encoding either by changing the encoding of the page itself to UTF-8 or by specifying accept-charset=utf-8 on the form element. @ http://localhost:8080/myapp/login The html does

g++ curly quotes displayed incorrectly in console and “Problems” list

主宰稳场 提交于 2020-01-12 07:38:09
问题 Recently, I switched from Visual Studio to Eclipse CDT. I've set it up beautifully such that the G++ compiler from my Cygwin installation can locate and compile my code without ado. There is a minor grievance, however. Each time G++ reports a warning or error, the curly single quotes ‘ and ’ appear as ‘ respectively ’ . It seems like a character encoding problem; G++ or Cygwin is spitting out a character encoding that either CDT or Eclipse doesn't like. This is only relevant Google result

How to handle unicode character sequences in C/C++?

我只是一个虾纸丫 提交于 2020-01-12 07:10:23
问题 What are the more portable and clean ways to handle unicode character sequences in C and C++ ? Moreover, how to: -Read unicode strings -Convert unicode strings to ASCII to save some bytes (if the user only inputs ASCII) -Print unicode strings Should I use the environment too ? I've read about LC_CTYPE for example, should I care about it as a developer ? 回答1: What are the more portable and clean ways to handle unicode character sequences in C and C++ ? Have all strings in your program be UTF-8

Mysql: Set column charset

馋奶兔 提交于 2020-01-11 18:14:07
问题 I have an existing table and I want to convert the charset only for one specific column to utf-8. I know that this command ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 does it for the whole table but I'm looking for a column-specific command. Is there a command for that? 回答1: Try this: ALTER TABLE t MODIFY col1 CHAR(50) CHARACTER SET utf8; 回答2: I share that, it can always help... I modified a database recently; moving from utf8 to utf8mb4; here is the script that allowed me to

Cannot display Greek characters .mdb file (PHP & ODBC)

依然范特西╮ 提交于 2020-01-11 12:49:05
问题 I am having problems displaying text from a column in an MS Access 2007 table which is in Greek. I am using PHP and $dbc = @odbc_pconnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $pass); to read from a local .mdb file. I can successfully read the rest of the data in the DB which is in Latin characters. Greek characters get displayed as � when I echo the results. The html charset is properly set to utf-8. I've tried using utf8_encode with no luck. I've been searching

Android: Character encoding raw resource files

蹲街弑〆低调 提交于 2020-01-11 10:33:34
问题 I'm in the process of translating one of my apps to Spanish, and I'm having a character encoding problem with a raw HTML file I'm sticking into a WebView. I have the spanish translation of the file in my raw-es folder, and I'm reading it in with the following function: private CharSequence getHtmlText(Activity activity) { BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(getResources().openRawResource(R.raw.help), "utf-8")); String line; StringBuilder buffer = new

\377\376 Appended to file (Windows -> Unix)

不想你离开。 提交于 2020-01-11 09:58:06
问题 Morning All - I have a problem and the solution has alluded me for a few days now. I have an SSIS package that performs the following. 1. Run SQL script 2. Export results to flat file (UTF-8 Encoded, ; delimitated, and \n for new lines) 3. FTP results to solaris machine ( binary format ) The problem is, that when the file is shows up on my solaris box it has the following at the start of the file. \377\376 I have tried dos2unix and still has not corrected the issue. In fact it changes the