character-encoding

Debugger console encoding in XCode is broken

拈花ヽ惹草 提交于 2020-01-06 19:45:08
问题 Non-latin text outputs very strange way in XCode debug console. How make it right? For example: Проверьте давление экрана. became –ü—Ä–æ–≤–µ—Ä–∫–∞ –¥–∞–≤–ª–µ–Ω–∏—è —ç–∫—Ä–∞–Ω–∞ (Help me please improve my question because my english is not good. Let me know If it's hard to understand what I wrote here.) - (id) initWithDictionary:(NSDictionary*)dictionary { //... self.title = [dictionary objectForKey:@"Заголовок"] ; // dictionary from plist encoded in UTF8 //... return self; } - (void) log {

PHP file_get_contents specific encoding

让人想犯罪 __ 提交于 2020-01-06 18:34:50
问题 i have one special issue with file_get_contents in PHP, here is code: $html = file_get_contents("http://www.bratm.sk/trochu-harlem-inspiracie-zaslite-nam-svoj-super-harlem-shake-ak-bude-husty-zverejnime-ho"); it gives me something like this í}KsŰĆŇčÚŽň!Ç& zRŚ|iI[#)öIkI ĆĺăĹŮÝĹÍý_ŐŃâ[EVßîV%Ů˙ëvĎ ř)śG#óčééééÇĚ çáÜöÁÖÉ;¤áˇ,rřĂăçť[DQ5íeaKÓśOśÉ?ě='šL¸ÔöLßä6ľ4mg_!JĂ÷˘Śu:L§án];9ŇÎV+ި1|C in some pages from this page i can get proper encoding and content with iconv, but here im helpless, how can i

String Encoding Issue - Need to convert 'Western European to Ascii'

情到浓时终转凉″ 提交于 2020-01-06 18:05:07
问题 I am facing a strange problem that my service would not return any results, if I search for a product name (eg: ABC 123 XYZ) by pasting the string in to the search text box in my winform app. The user follows this mode and faces the problem to search: A table with product names in outlook - copied in to excel - and then a string from that table in excel is copied in to my application's search text box to search. The same string when I type it in manually(ABC 123 XYZ) in to my search box,

Logstash file input: registering json file grew but not taking data in some cases

牧云@^-^@ 提交于 2020-01-06 10:04:53
问题 My config file is shown below: input { file { codec => "json" path => "/home/data/*" sincedb_path => "/dev/null" } } output { elasticsearch{ protocol => "http" host => "localhost" index => "data" } } When I download a .json file to the data directory, logstash will not receive the data or output to elasticsearch unless I first open the file and save it in gedit. Running logstash with the -vvv flag shows no errors all I get when a file is put in that directory is _discover_file: /home/data/*:

Transcoding characters on-the-fly using iostreams and ICU

旧巷老猫 提交于 2020-01-06 08:36:13
问题 I'd like to transcode character encoding on-the-fly. I'd like to use iostreams and my own transcoding streambuf , e.g.: xcoder_streambuf xbuf( "UTF-8", "ISO-8859-1", cout.rdbuf() ); cout.rdbuf( &xbuf ); char *utf8_s; // pointer to buffer containing UTF-8 encoded characters // ... cout << utf8_s; // characters are written in ISO-8859-1 The implementation of xcoder_streambuf would use ICU's converters API. It would take the data coming in (in this case, from utf8_s ), transcode it, and write it

Java cyrillic encoding

牧云@^-^@ 提交于 2020-01-06 08:22:35
问题 I have input string - UAH;"Ãîëüô 855229-7" , it should be displayed like UAH;"Гольф 855229-7" , I'm trying to use Cp1251 encoding, but get output UAH;"????? 855229-7" . String cyrillic = row[0] + row[1]; String utf8String= new String(cyrillic.getBytes("Cp1251"), "UTF-8"); lbl1.setText(utf8String); 回答1: UTF-8 has nothing to do with this. All of your characters in cyrillic are being represented as single bytes. Currently, those bytes are in the ISO 8859-1 encoding, also known as Latin-1, which

Ruby on Rails - encoding issue

心已入冬 提交于 2020-01-06 08:06:16
问题 I am running a RoR app that pulls data from some event tables which are using utf8_general_ci as collation. The problem is that all my pages render stuff like this: Atat�rk Stadi Nov 02 20:00 So far I have tried: - changing the encoding within application.rb adding <meta charset="utf-8" /> adding content="text/html;charset=utf-8" all combinations of above tags with all possible relevant encodings that may apply to our content. Document type is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

User submitted CSV file upload UTF-8 concern

为君一笑 提交于 2020-01-06 07:21:17
问题 I have a feature that uploads a user submitted CSV file into my database using fgetcsv etc. My database has a collation of utf8_general_ci and the website charset is set to utf-8. How can I ensure that when inserting the data from CSV into my database for display on the website, the correct encoding is set? Do I have to test every string using something like mb_detect_encoding (seems a bit memory intensive) or can I just utf8_encode the whole string. Or should I not be worrying at all? 回答1:

Encoding issue of Euro sign

梦想的初衷 提交于 2020-01-06 06:44:53
问题 i have this code when i run it, it give me "?" instead of "€" (euro sign). Can anyone tell me what i can do to fix it. string Message = "Hello $ € £"; Encoding iso = Encoding.GetEncoding("ISO-8859-1"); Encoding utf8 = Encoding.UTF8; byte[] utfBytes = utf8.GetBytes(Message); byte[] isoBytes = Encoding.Convert(utf8, iso, utfBytes); string msg = iso.GetString(isoBytes); Console.WriteLine(msg); 回答1: string Message = "Hello $ € £"; Console.OutputEncoding = Encoding.UTF8; Console.WriteLine(Message)

json library interprets space characters as “\xa0”

孤街醉人 提交于 2020-01-06 06:05:54
问题 When I load a json-file into python there's no problem with encodings as long as the file is treated as a string. However, loading the file into json-format either using json.load on the file or json.loads on the string all space characters come out as "\xa0" The following code yields normal results, printing the json-string without any funky "\xa0" signs. with open(json_path) as f: lines = f.readlines() for line in lines: print(line) Loading the file into json-format and suddently space