encoding

What's the difference between Encoding.GetEncoding(1255) and Encoding.GetEncoding(1252)?

I have a C# form based program and have been using System.Text.Encoding.GetEncoding(1252) but I've had trouble reading non-English characters, I've discovered System.Text.Encoding.GetEncoding(1255) works however I don't know the implications of changing this so I'm hoping someone can shed some light on the difference and possible implica...

What kind of encoding is this?

What kind of encoding do you use to encode http:// as http%253A%252F%252F HttpUtility.UrlEncode gives http%3a%2f%2f ...

Unicode strings in my C# App are shown with question marks

Hi, I have a header file in C++/CLI project, which contains some strings in different languages. arabic, english, german, chinese, french, japanese etc... I have a second project written in C#. Here I access the strings stored in the header file of the C++/CLI project. The encoding of the header file is Unicode - Codepage 1200 or UTF...

Error: "Input is not proper UTF-8, indicate encoding !" using PHP's simplexml_load_string

I'm getting the error: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xED 0x6E 0x2C 0x20 When trying to process an XML response using simplexml_load_string from a 3rd party source. The raw XML response does declare the content type: <?xml version="1.0" encoding="UTF-8"?> Yet it seems that the XML is not really ...

What's the encoding of the content of an HTTP request?

Is this defined? Or is it set with a header, similar to the HTTP-response? ...

Convert UTF-8 bytes to some other encoding in Python

I need to do in Python 2.4 (yes, 2.4 :-( ). I've got a plain string object, which represents some text encoded with UTF-8. It comes from an external library, which can't be modified. So, what I think I need to do, is to create an Unicode object using bytes from that source object, and then convert it to some other encoding (iso-8859-2,...

Why is no encoding set in response by Tomcat? How can I deal with it?

I had recently a problem with encoding of websites generated by servlet, that occurred if the servlets were deployed under Tomcat, but not under Jetty. I did a little bit of research about it and simplified the problem to the following servlet: public class TestServlet extends HttpServlet implements Servlet { @Override public vo...

Regex, encoding, and characters that look a like

First, a brief example, let's say I have this "/[0-9]{2}°/" regex and this text "24º". The text won't match, obviusly ... (?) really, it depends on the font. Here is my problem, I do not have control on which chars the user uses, so, I need to cover all possibilities in the regex /[0-9]{2}[°º]/, or even better, assure that the text has ...

SWF transcoding, does it exist?

Hey all, I am looking for some type of SWF transcoder so I can convert SWF files to .avi's. Preferably something that we could hook into our Java architecture. Any suggestions? ...

Character encoding issues when generating MD5 hash cross-platform

This is a general question about character encoding when using MD5 libraries in various languages. My concern is: suppose I generate an MD5 hash using a native Python string object, like this: message = "hello world" m = md5() m.update(message) Then I take a hex version of that MD5 hash using: m.hexdigest() and send the message & M...

C# - File Encoding Problem.

Hello, I'm have a StringBuilder that is writing content to a file. Towards the end of each file, I'm writing the copyright symbol. Oddly, I have noticed that whenever the copyright symbol is written, it is preceeded by a "Â". My code that generates the content of the file looks like this: using (StringWriter stringWriter = new StringWr...

Encoding issues with Spring and Freemarker

I'm working on a project using Freemarker and Spring running on Jetty. It will involve displaying characters from many different countries so I'm trying to set the encoding to UTF-8. However, no matter what I do, it remains ISO-8859-1. I tried to create a filter in my web.xml and I've tried putting this response.setCharacterEncodin...

Having encoding problems in Aptana Studio

A few months ago, I was working on a PHP project in Aptana Studio. It was version 1.5 or something. Later I installed Aptana 2.0 and created a new project with the same files. Back then it was UTF-8 so I chose UTF-8 for the project's text file encoding. When I make changes in any PHP file using Aptana, it gives the error: Warning: Ca...

Variable-byte encoding clarification

Hello: I am very new to the world of byte encoding so please excuse me (and by all means, correct me) if I am using/expressing simple concepts in the wrong way. I am trying to understand variable-byte encoding. I have read the Wikipedia article (http://en.wikipedia.org/wiki/Variable-width_encoding) as well as a book chapter from an Inf...

Problem retrieving Strings from varbinary columns using HIbernate and MySQL

Hello, Here's my scenario. I save a bunch of Strings containing asian characters in MySQL using Hibernate. These strings are written in varbinary columns. Everything works fine during the saving operation. The DB contains the correct values (sequence of bytes). If I query (again using Hibernate) for the Strings that I saved I get the co...

Debugging ASP.NET Strings Downloaded to Browser (Montréal instead of Montréal)

I'm downloading a vCard to the browser using Response.Write to output .NET strings with special accented characters. Mime type is text/x-vcard and French characters are appearing wrong in Outlook, for example Montréal;Québec .NET string shows as Montréal Québec in browser. Apparently vCard default format is ASCII. .NET strings are U...

I dont know how or where to add the correct encoding code to this iPhone code...

Ok, I understand that using strings that have special characters is an encoding issue. However I am not sure how to adjust my code to allow these characters. Below is the code that works great for text that contains no special characters, but can you show me how and where to change the code to allow for the special characters to be used....

[Cocoa] NSTask string encoding problem

Hi, In my program, I'm grep-ing via NSTask. For some reason, sometimes I would get no results (even though the code was apparently the same as the command run from the CLI which worked just fine), so I checked through my code and found, in Apple's documentation, that when adding arguments to an NSTask object, "the NSTask object converts...

Python: UTF-8 problems (again...)

I have a database which is synchronized against an external web source twice a day. This web source contains a bunch of entries, which have names and some extra information about these names. Some of these names are silly and I want to rename them when inserting them into my own database. To rename these silly names, I have a standard d...

What is WordPress doing for content encoding in its MySQL database?

For some convoluted reasons best left behind us, I require direct access the contents of a WordPress database. I'm using MySQL 5.0.70-r1 on Gentoo with WordPress 2.6, and Perl 5.8.8 ftr. So, sometimes we get high-order characters in the blog, we have quite a few authors contributing too, for the most part these characters end up in Wor...