utf-8

JSON.stringify() to UTF-8

为君一笑 提交于 2020-01-22 14:38:38
问题 Javascript uses as far as I know UTF-16 fundamentally as a standard for strings. With JSON.stringify() I can create a JSON string from an object. Is that JSON string UTF-16 encoded? Can I convert (hopefully fast) that string to UTF-8 to save bandwidth for huge files (1MB JSON)? 回答1: JavaScript engines are allowed to use either UCS-2 or UTF-16. So, yes, JSON.stringify() will return a string in whatever encoding your implementation uses for strings. If you were to find a way to change that

How do I export an Excel file with Chinese characters to a CSV?

╄→гoц情女王★ 提交于 2020-01-22 10:43:09
问题 I having a Excel document with a data table containing Chinese characters. I am trying to export this Excel spreadsheet to a CSV file for importing into a MySQL database. However, when I save the Excel document as a CSV file, Notepad displays the resulting CSV file's Chinese characters as question marks. Importing into MySQL preserves the question marks, completely ignoring what the original Chinese characters are. I'm suspecting this may have to do with using Excel with UTF-8 encoding.

Visualisation of uft-8 (Polish) not working properly

ぐ巨炮叔叔 提交于 2020-01-22 00:37:25
问题 My software supports multiple languages (English, German, Polish, Russian, ...). For this reason I have some language specific files with the dialog texts in the specific language (Encoded as UTF-8). In my mfc application I open and read those files and insert the text into my AfxMessageBoxes and other UI-Windows. // Get the codepage number. 65001 = UTF-8 // In the real code this is a parameter in the function I call (just for clarification) LANGID languageID = 65001; TCHAR szCodepage[10];

How to get text/xml as UTF-8 from a multipart/form-data request with RESTeasy?

我与影子孤独终老i 提交于 2020-01-21 23:52:47
问题 thanks for your answer, but using an InputStream instead of using getBody(...) does also not work. The code below returns the same result as the one from my original post. final InputStream inStream = fileUploadInput.getFormDataPart(searchedInput, InputStream.class, null); // get bytes final byte[] inBytes = new byte[1024]; final ByteArrayOutputStream outBytes = new ByteArrayOutputStream(inBytes.length); int length = 0; while((length = inStream.read(inBytes)) >= 0) { outBytes.write(inBytes, 0

CDO.Message encoding issue

筅森魡賤 提交于 2020-01-21 12:22:14
问题 We're currently changing our mail delivery system to use solely UTF-8 . There seems to be a problem with the sender name, when the email contains non ASCII chars (hebrew) the subject & body render ok, but the sender name, as it appears in my gmail account, becomes - ?????? . There is a line of code: myMail.BodyPart.Charset = "UTF-8" So I thought there should be some code of the like: myMail.SenderName.Charset = "UTF-8" But I can't seem to find the right code to use, assuming this would do the

Php str_replace not working with special chars

与世无争的帅哥 提交于 2020-01-21 12:10:50
问题 why isn't this working as expected: echo str_replace("é","é","Fédération Camerounaise de Football"); result: "Fédération Camerounaise de Football" i'm expecting to have: "Fédération Camerounaise de Football" 回答1: You are doing it wrong. This string is not incorrect and in need of replacement, it is simply encoded with UTF-8. All you have to do is utf8_decode('Fédération Camerounaise de Football') . Update: You are seeing Fédération Camerounaise de Football as output because you are

Utf8 correct regex for CamelCase (WikiWord) in perl

房东的猫 提交于 2020-01-21 11:44:09
问题 Here was a question about the CamelCase regex. With the combination of tchrist post i'm wondering what is the correct utf-8 CamelCase . Starting with (brian d foy's) regex: / \b # start at word boundary [A-Z] # start with upper [a-zA-Z]* # followed by any alpha (?: # non-capturing grouping for alternation precedence [a-z][a-zA-Z]*[A-Z] # next bit is lower, any zero or more, ending with upper | # or [A-Z][a-zA-Z]*[a-z] # next bit is upper, any zero or more, ending with lower ) [a-zA-Z]* #

Php + Mysql (UTF-8 ) some characters are still bug

浪子不回头ぞ 提交于 2020-01-21 08:18:53
问题 Well i got a php script that takes nicknames from a the Steam web-api and insert them into a mysql db. Many of them got rare russian and greek characters. I set php to utf-8 in the php.ini and in all the php files with mb_internal_encoding('utf-8'); My PDO connector is configured to handle utf8 $connection = new PDO('mysql:host=localhost;dbname=d2bd;mysql:charset=utf8mb4', 'root', ''); $connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $connection->setAttribute(PDO::ATTR_ERRMODE,

Php + Mysql (UTF-8 ) some characters are still bug

不打扰是莪最后的温柔 提交于 2020-01-21 08:18:44
问题 Well i got a php script that takes nicknames from a the Steam web-api and insert them into a mysql db. Many of them got rare russian and greek characters. I set php to utf-8 in the php.ini and in all the php files with mb_internal_encoding('utf-8'); My PDO connector is configured to handle utf8 $connection = new PDO('mysql:host=localhost;dbname=d2bd;mysql:charset=utf8mb4', 'root', ''); $connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $connection->setAttribute(PDO::ATTR_ERRMODE,

Php + Mysql (UTF-8 ) some characters are still bug

此生再无相见时 提交于 2020-01-21 08:18:04
问题 Well i got a php script that takes nicknames from a the Steam web-api and insert them into a mysql db. Many of them got rare russian and greek characters. I set php to utf-8 in the php.ini and in all the php files with mb_internal_encoding('utf-8'); My PDO connector is configured to handle utf8 $connection = new PDO('mysql:host=localhost;dbname=d2bd;mysql:charset=utf8mb4', 'root', ''); $connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $connection->setAttribute(PDO::ATTR_ERRMODE,