windows-1252

Characters with ASCII > 128 are not correctly read in Javascript

有些话、适合烂在心里 提交于 2019-12-04 09:03:57
I have a HTML that includes a Javascript file. This script contains a special character, ASCII 152. When I try to display the charCodeAt, I get different results, but never the right one. Could you please advice? Thanks TEST.HTML <script type="text/javascript" charset=SEE BELOW src="test.js"> </script> TEST.JS file with ANSI encoding function d(a) { a=(a+"").split(""); alert(a[1].charCodeAt(0)); }; d("i˜g"); // Note that ˜ is 152 in ASCII TEST.HTML with x-user-defined charset: alert shows 63384. With %63232 works, as every char >128 is displayed as 63232+char. TEST.HTML with utf-8 charset:

Windows -1252 is not supported encoding name

孤者浪人 提交于 2019-12-04 05:48:52
I am working with windows 10 universal App and the ARM CPU to create apps for the Raspberry Pi. I get the following error with encoding: Additional information: 'windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. private async void Login(string passcode) { try { MySqlConnection conn = new MySqlConnection("Server=..."); MySqlCommand cmd; conn.Open(); cmd = new MySqlCommand("Select * from ..."); var dr = cmd.ExecuteReader(); int count = 0; while (dr.Read()) count += 1; var dialog = new

Character Set Special Characters

て烟熏妆下的殇ゞ 提交于 2019-12-03 14:59:39
Is iso-8859-1 a proper subset of utf-8? What about iso-8859-n? What about windows-1252? If the answer is no to any of the above, what are the disjoint characters? I'm testing some logic that detects charsets and want to write tests to verify the detection is working properly. Is iso-8859-1 a proper subset of utf-8? The character reportoire of ISO-8859-1 (the first 256 characters of Unicode) is a proper subset of that of UTF-8 (every Unicode character). However, the characters U+0080 to U+00FF are encoded differently in the two encodings. ISO-8859-1 assigns each of these characters a single

How to convert Windows-1252 characters to values in php?

末鹿安然 提交于 2019-12-01 18:24:42
We have several database fields that contain Windows-1252 characters: an example pain— if you’re Those values map to the desired values from this list: http://www.i18nqa.com/debug/utf8-debug.html I've tried various permutations of htmlentites, mb_detect_encoding, uft8_decode, etc, but have not yet been able to transform those values to: an example pain — if you're How can I transform these characters to their listed values in php? You can use mb_convert_encoding $str = "an example pain— if you’re"; $str = mb_convert_encoding($str, "Windows-1252", "UTF-8"); echo $str; //an example pain—

Reading Windows-1252 encoding in Windows Phone 8

浪子不回头ぞ 提交于 2019-11-30 23:58:02
In Windows, I can use the Encoding.GetEncoding ("Windows-1252") via .NET to retrieve the "Windows-1252" code page encoding. Unfortunately, this call throws an ArgumentExtception in Windows Phone 8 emulator, specifying that the encoding name is not valid. I looked around MSDN but didn't find anything useful. Does anyone know about which encodings are available in Windows Phone 8 and which is the new name of the "Windows-1252" encoding? And yes, I am aware of the alternative option of using the "iso-8859-1" encoding and manually substituting the characters in the 129-159-range. But I'm trying to

Reading Windows-1252 encoding in Windows Phone 8

馋奶兔 提交于 2019-11-30 18:48:18
问题 In Windows, I can use the Encoding.GetEncoding ("Windows-1252") via .NET to retrieve the "Windows-1252" code page encoding. Unfortunately, this call throws an ArgumentExtception in Windows Phone 8 emulator, specifying that the encoding name is not valid. I looked around MSDN but didn't find anything useful. Does anyone know about which encodings are available in Windows Phone 8 and which is the new name of the "Windows-1252" encoding? And yes, I am aware of the alternative option of using the

Java convert Windows-1252 to UTF-8, some letters are wrong

那年仲夏 提交于 2019-11-29 08:47:38
I receive data from external Microsoft SQL 2008 Data base (I make Queries with MyBatis). In theroy I receive data encoding on "Windows-1252". I try decoded data with this code: String textoFormado = ...value from MyBatis... ; String s = new String(textoFormado.getBytes("Windows-1252"), "UTF-8"); Almost all the String is correctly decoded. But some letter with acents not. For Example: I Receive from Data base this String: "Ã�vila" I use the above code and this make this String: "�?vila" I expected this String: "Ávila" Obviously, textoFormado is a variable of type String . This means that the

Converting Unicode to Windows-1252 for vCards

烂漫一生 提交于 2019-11-28 12:23:47
I am trying to write a program in C# that will split a vCard (VCF) file with multiple contacts into individual files for each contact. I understand that the vCard needs to be saved as ANSI (1252) for most mobile phones to read them. However, if I open a VCF file using StreamReader and then write it back with StreamWriter (setting 1252 as the Encoding format), all special characters like å , æ and ø are getting written as ? . Surely ANSI (1252) would support these characters. How do I fix this? Edit: Here's the piece of code I use to read and write the file. private void ReadFile() {

How to read a file in Java with specific character encoding?

ε祈祈猫儿з 提交于 2019-11-28 09:02:06
I am trying to read a file in as either UTF-8 or Windows-1252 depending on the output of this method: public Charset getCorrectCharsetToApply() { // Returns a Charset for either UTF-8 or Windows-1252. } So far, I have: String fileName = getFileNameToReadFromUserInput(); InputStream is = new ByteArrayInputStream(fileName.getBytes()); InputStreamReader isr = new InputStreamReader(is, getCorrectCharsetToApply()); BufferedReader buffReader = new BufferedReader(isr); The problem I'm having is converting the BufferedReader instance to a FileReader . Furthermore: The name of the file itself (

Java convert Windows-1252 to UTF-8, some letters are wrong

北战南征 提交于 2019-11-28 01:49:14
问题 I receive data from external Microsoft SQL 2008 Data base (I make Queries with MyBatis). In theroy I receive data encoding on "Windows-1252". I try decoded data with this code: String textoFormado = ...value from MyBatis... ; String s = new String(textoFormado.getBytes("Windows-1252"), "UTF-8"); Almost all the String is correctly decoded. But some letter with acents not. For Example: I Receive from Data base this String: "Ã�vila" I use the above code and this make this String: "�?vila" I