tagged [character-encoding]

How to change the DataContractSerializer text encoding?

How to change the DataContractSerializer text encoding? When writing to a stream the `DataContractSerializer` uses an encoding different from Unicode-16. If I could force it to write/read Unicode-16 I...

C# Mysql UTF8 Encoding

C# Mysql UTF8 Encoding I have a mysql database with utf8_general_ci encoding , i'm connecting to the same database with php using utf-8 page and file encode and no problem but when connection mysql wi...

27 Jul at 13:48

Converting text file from ANSI to ASCII using C#

Converting text file from ANSI to ASCII using C# I have an ANSI-encoded file, and I want to convert the lines I read from the file to ASCII. How do I go about doing this in C#? --- What if i used "Bin...

22 Feb at 14:38

How can I determine the character encoding of an excel file?

How can I determine the character encoding of an excel file? > [Excel to CSV with UTF8 encoding](https://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding) Scenario: I have an exce...

23 May at 12:1

How do I convert between ISO-8859-1 and UTF-8 in Java?

How do I convert between ISO-8859-1 and UTF-8 in Java? Does anyone know how to convert a string from ISO-8859-1 to UTF-8 and back in Java? I'm getting a string from the web and saving it in the RMS (J...

How to get a char from an ASCII Character Code in C#

How to get a char from an ASCII Character Code in C# I'm trying to parse a file in C# that has field (string) arrays separated by ASCII character codes 0, 1 and 2 (in Visual Basic 6 you can generate t...

23 Mar at 00:24

How to open html file that contains Unicode characters?

How to open html file that contains Unicode characters? I have html file called `test.html` it has one word `בדיקה`. I open the test.html and print it's content using this block of code: but it prints...

ERROR 1115 (42000): Unknown character set: 'utf8mb4'

ERROR 1115 (42000): Unknown character set: 'utf8mb4' I have a MySQL dump, which I tried to restore with: ``` mysql -u"username" -p"password" --host="127.0.0.1" mysql_db

17 Aug at 14:2

JsonParseException : Illegal unquoted character ((CTRL-CHAR, code 10)

JsonParseException : Illegal unquoted character ((CTRL-CHAR, code 10) I'm trying to use `org.apache.httpcomponents` to consume a Rest API, which will post JSON format data to API. I get this exception...

How do I correct the character encoding of a file?

How do I correct the character encoding of a file? I have an ANSI encoded text file that should not have been encoded as ANSI as there were accented characters that ANSI does not support. I would rath...

Python: Converting from ISO-8859-1/latin1 to UTF-8

Python: Converting from ISO-8859-1/latin1 to UTF-8 I have this string that has been decoded from Quoted-printable to ISO-8859-1 with the email module. This gives me strings like "\xC4pple" which would...

26 Mar at 09:22

How do I get a consistent byte representation of strings in C# without manually specifying an encoding?

How do I get a consistent byte representation of strings in C# without manually specifying an encoding? How do I convert a `string` to a `byte[]` in .NET (C#) without manually specifying a specific en...

26 Feb at 22:22

"for line in..." results in UnicodeDecodeError: 'utf-8' codec can't decode byte

"for line in..." results in UnicodeDecodeError: 'utf-8' codec can't decode byte Here is my code, Whenever I run this code it gives the following error: > UnicodeDecodeError: 'utf-8' codec can't decode...

30 Jan at 16:27

How to change character encoding of XmlReader

How to change character encoding of XmlReader I have a simple XmlReader: The problem is, the Xml file has `ISO-8859-9` characters in it, which makes XmlReader throw "`Invalid character in the given en...

How to have multiple colors in a Windows batch file?

How to have multiple colors in a Windows batch file? I was wondering if its possible to have different colored text on the same line in a Windows batch file, for example if it says I want "hi" to be o...

What does "Content-type: application/json; charset=utf-8" really mean?

What does "Content-type: application/json; charset=utf-8" really mean? When I make a POST request with a JSON body to my REST service I include `Content-type: application/json; charset=utf-8` in the m...

13 Feb at 02:37

Java, default encoding

Java, default encoding > [What is the default encoding of jvm?](https://stackoverflow.com/questions/1006276/what-is-the-default-encoding-of-jvm) Hello, what is the default character encoding in Java...

23 May at 12:30

Deserialize XML with UTF-16 encoding in ServiceStack.Text

Deserialize XML with UTF-16 encoding in ServiceStack.Text I am trying to use ServiceStack.Text to deserialize some XML. Code: The opening xml line is: ServiceStack fails with the following error: > Th...

How to Generate all the characters in the UTF-8 charset in .net

How to Generate all the characters in the UTF-8 charset in .net I have been given the task of generating all the characters in the UTF-8 character set to test how a system handles each of them. I do ...

3 Nov at 16:43

JSON character encoding

JSON character encoding My Java web application submits an AJAX request that returns JSON such: When 'aériennes' is displayed in the webpage, it appears as 'a�riennes', so I guess there's some kind of...

What are the valid URL characters that can be used in a query variable?

What are the valid URL characters that can be used in a query variable? What are the valid characters that can be used in a URL query variable? I'm asking because I would like to create GUIDs of minim...

7 Jun at 16:53

Difference between Encoding.UTF8.GetBytes and UTF8Encoding.Default.GetBytes

Difference between Encoding.UTF8.GetBytes and UTF8Encoding.Default.GetBytes Can someone please explain me what is the difference bet. Encoding.UTF8.GetBytes and UTF8Encoding.Default.GetBytes? Actually...

7 Jun at 22:53

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128) I am parsing an XSL file using xlrd. Most of the things are working fine. I have a diction...

4 Aug at 09:34

How to change the default encoding to UTF-8 for Apache

How to change the default encoding to UTF-8 for Apache I am using a hosting company and it will list the files in a directory if the file `index.html` is not there. It uses [ISO 8859-1](https://en.wik...

Write to UTF-8 file in Python

Write to UTF-8 file in Python I'm really confused with the `codecs.open function`. When I do: It gives me the error > UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal n...