encoding

Testing email encoded for Japanese

After figuring out how to encode email that will be read by a Japanese user (encoding for IS0-2022-JP and then base64 encoding), I need to figure out how to test that this actually works. I'm not fluent in Japanese. How does one go about testing that the email reads correctly? The message I'm sending would be written by my program in Eng...

How to separate content from a file that is a container for binary and other forms of content

I am trying to parse some .txt files. These files serve as containers for a variable number of 'children' files that are set off or identified within the container with SGML tags. With python I can easily separate the children files. However I am having trouble writing the binary content back out as a binary file (say a gif or jpg). ...

Reading data from UTF-8 text file and tokenize

I'm trying to read UTF-8 from a text file and do some tokenization, but I'm having issues with the encoding: try { fis = new FileInputStream(fName); } catch (FileNotFoundException ex) { //... } DataInputStream myInput = new DataInputStream(fis); try { while (thisLine = myInput.readLine()) != null) { StringTokeniz...

Creating html attachment from xslt, encoding issues, asp.net

I am trying to create an html attachment by processing some of my xml through an xsl transform and sending it to the client. If I click "open", IE shows the html properly, but if I save the attachment and then open it in Firefox, every place there was a   I'm getting a "Â" character. I have a feeling this has to do with our encoding. Her...

ByteArrayOutputStream to CharBuffer

I have an input ByteArrayOutputStream and need to convert that to a CharBuffer. I was trying to avoid creating a new string. Is there anyway to do this. I was trying to do the following, but I don't have the encoding for the string so the code below will not work (invalid output). ByteBuffer byteBuffer = ByteBuffer.wrap(byteOutputStr...

PHP MySQL Encoding Bug?

Heres my problem. I have a mysql table called quotes. In one of the rows, a quote contains the folloqing characters ‘ and ’ Now the row collation is utf8__unicode__ci When using MySQL Query Browser and PHPMyAdmin to retrive the rows the quotes come out as intended. How ever when i retrive them from the database using PHP and display ...

Why Encoding.ASCII != ASCIIEncoding.Default in C#?

Why does Encoding.ASCII != ASCIIEncoding.Default in C#? ...

How to send HTML as GET-Request parameter?

I would like to send a html string with a GET request like this with Apaches HttpClient: http://sample.com/?html=&lt;html&gt;&lt;head&gt;... This doesnt work at the moment, i think its an encoding problem. Do you have any ideas how to do that? method.setQueryString(new NameValuePair[] {new NameValuePair("report", "<html>....")}); cli...

how to change source file encoding in csharp project (visual studio / msbuild machine)?

Hello, I'm working on a winapp csproject using Visual Studio 2008 on Vista (polish locale) The problem appears when I build project on Win Server 2003 (english locale) - then polish diacritic is gone. I investigated that the issue is caused by improper source file encoding. It looks that source files aren't in UTF-8. Is there a way to...

Export animation sequence from Flash as JPEGs

I'm wondering if it's possible at all to sort of record/capture the state of an swf movie over a period of time and save it all down as jpgs to the server? AS3 has the new com.adobe.images.JPGEncoder class that seems to do the job, but can I capture a sequence? The hope would be that I could put it back together as a video or animation...

Web server - when should I use chunked transfer encoding ?

Looking at various web servers HTTP Headers, I notice that Google.com has: client-transfer-encoding: "chunked" What is chuncked transfer encoding and should I be using it on my web server? ...

What's all the binary stuff I get from Perl's Image::Info::image_info()?

I get the following output after running the code for a picture [1459]./image_info.pl lah.png $VAR1 = { 'width' => 206, 'file_media_type' => 'image/png', 'file_ext' => 'png', 'PNG_Chunks' => [ 'IHDR', ?V?????O?H??^#?C&?fu?M?5V??m6???M?s', 'IE...

Can I use Unicode to decode an HTTP request?

I understand that the default encoding of an HTTP Request is ISO 8859-1. Am I able to use Unicode to decode an HTTP request given as a byte array? If not, how would I decode such a request in C#? EDIT: I'm developing a server, not a client. ...

How do I convert stored misencoded data?

My Perl app and MySQL database now handle incoming UTF-8 data properly, but I have to convert the pre-existing data. Some of the data appears to have been encoded as CP-1252 and not decoded as such before being encoded as UTF-8 and stored in MySQL. I've read the O'Reilly article Turning MySQL data in latin1 to utf8 utf-8, but although it...

Hsqldb table encoding

How do I set the character encoding for a specific table? E.g: CREATE TABLE COMMENTS ( ID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 0, INCREMENT BY 1) NOT NULL, TXT LONGVARCHAR, PRIMARY KEY (ID) ) By default it's encoded as ASCII but I'd rather use UTF-8 for this one table. ...

database physical storage for character type

Hello everyone, For SQL Server 2005/2008, after some self-study, I am not sure whether my understanding about how character data type is physically stored is correct. Please help to review and comment. Here is my understanding, please review and feel free to correct me. when using unicode character type (e.g. nvarchar), underlying cha...

%2B decoding to a space instead of a plus

We have a problem in a specific server. All plus signs posted to the application are replaced with spaces - that's in POST and GET, and on all pages on that site. As a test case I have this little page (it's an ASP server): <html> <body> <form method="post"> <input type="text" name="Plus" id="Plus" /> <input type="submit" />...

Encode wav file to pcm

Hello everybody, I need to encode a wav file to another file format (pcm). This format has to following properties: 8kHz, 16-bit. Has anybody an idea how to do this in c# or vb? Thank you in advance, JaQ ...

JQuery Escaping HTML for Preview

I am making a very simple preview window in JQuery using just an ordered list. I am worried the user will type in < or > and accidentally mess up the code for the page or do some sort of XSS. How can I encode special chars using Javascript to handle this situation? ...

How to save a .net XML Document to a path with an & in it

I am saving an XMLDocument object to disk using the Save (string) function. When I do this I get a "Could not find a par of the path" error. I have tried passing the characters as "&", "&", "%26", "\26", and "\38". What am I missing? Note that I am not talking about the content of the file -- but the filename. Dim todocument As New ...