cp1250

mb_detect_encoding doesn't properly working with Windows-1250 (CP1250)

不问归期 提交于 2019-12-11 03:28:31
问题 I have problem with detecting CP1250 in mb_detect_encoding(), in my case I want detect 3 encodings: mb_detect_encoding($string, 'UTF-8,ISO-8859-2,Windows-1250') But Windows isn't in supported encodings, any solution? 回答1: mb_detect_encoding always "detects" single-byte encodings. You can read about this in the documentation for mb_detect_order: mbstring currently implements the following encoding detection filters. If there is an invalid byte sequence for the following encodings, encoding

Convert string from codepage 1252 to 1250

末鹿安然 提交于 2019-12-06 07:21:38
问题 How can I convert one String with characters decoded in codepage 1252 into a String decoded in codepage 1250. For example String str1252 = "ê¹ś¿źæñ³ó"; String str1250 = convert(str1252); System.out.print(str1250); I want to find such convert() function, that printed output would be: ęąśżźćńłó These are Polish-specific characters. Thank you for any suggestions. 回答1: It's pretty straightforward: public String convert(String s) { return new String(s.getBytes("Windows-1252"), "Windows-1250"); }

Convert string from codepage 1252 to 1250

谁说我不能喝 提交于 2019-12-04 16:27:12
How can I convert one String with characters decoded in codepage 1252 into a String decoded in codepage 1250. For example String str1252 = "ê¹ś¿źæñ³ó"; String str1250 = convert(str1252); System.out.print(str1250); I want to find such convert() function, that printed output would be: ęąśżźćńłó These are Polish-specific characters. Thank you for any suggestions. axtavt It's pretty straightforward: public String convert(String s) { return new String(s.getBytes("Windows-1252"), "Windows-1250"); } Note that System.out.print() can introduce another incorrect conversion due to mismatch between ANSI