utf-8

How to set Google App Engine java Content-Type to UTF-8

It seems I cannot get UTF-8 encoding to be sent in the response headers. I tried using this to no avail: resp.setHeader("Content-Encoding", "utf-8"); Does anyone know when is this bug to be fixed or is there a workaround? References: http://groups.google.com/group/google-appengine/browse_thread/thread/68a480cb7bec869e http://www.oz...

Converting Xml UTF-8 to ISO-8859-9 in c#

i have a long xml document just created by string builder with the starting tag like <?xml version="1.0" encoding="UTF-8"?> <xxxxxx> .. </xxxxxx> and i want to convert this xml to iso-8859-9 encoding type. How can i do this? Or anyone suggests me another way to create ISO-8859-9 encoding type xml in C#. ...

How to enforce internet explorer to use encoding given in meta tag?

I'm trying to prepare a demo html page with mixed english and arabic content. Basically it contains a small table with english phrases on the left, and the arabic translation on the right side. Because I don't understand arabic, I took the first three characters of the arabic alphabet from the Unicode reference. First attempt, using th...

Read UTF-8 XML with MSXML 4.0

I have a problem with classc ASP / VBScript trying to read an UTF-8 encoded XML file with MSXML. The file is encoded correctly, I can see that with all other tools. Constructed XML example: <?xml version="1.0" encoding="UTF-8"?> <itshop> <Product Name="Backup gewünscht" /> </itshop> If I try to do this in ASP... Set fso = Server...

HTML encoding of a string pasted from Word

See http://pilot.whatpub.org/Guide/002000/Pub002687.htm and have a look at the source. The text in the description ("Refurbished in 2005...") has been pasted from a Word document into a System.Web.UI.WebControls.TextBox and then saved into a database as unicode. It's obviously got some non-ASCII characters in there that IE interprets s...

Sorting UTF-8 strings in RoR

I am trying to figure out a 'proper' way of sorting UTF-8 strings in Ruby on Rails. In my application, I have a select box that is populated with countries. As my application is localized, each existing locale has a countries.yml file that relates a country's id to the localized name for that country. I can't sort the strings manually i...

UTF-8 problem in python when reading chars

I'm using Python 2.5. What is going on here? What have I misunderstood? How can I fix it? in.txt: Stäckövérfløw code.py #!/usr/bin/env python # -*- coding: utf-8 -*- print """Content-Type: text/plain; charset="UTF-8"\n""" f = open('in.txt','r') for line in f: print line for i in line: print i, f.close() output: Stäck...

How did my ASPX page become UTF-8? I didn't ask for it.

Yesterday, after a minor markup edit to an aspx page, I was checking the file(s) back into TFS 2005 when I got the message that, "The file encoding has changed from ANSI to UTF-8. Checking the file in with this encoding will cause problems with Compares, etc." or words to that effect. Helpfully, the dialog gave the options 'OK' and 'He...

PHP: 2 strings - which one is UTF-8 and which one not?

Hello! I have a database with lots of strings. Some of them are correctly UTF-8 encoded, some of them not. Therefore, I've set up a script which selects 100 strings from the db. The following function decides whether a string contains UTF-8 or not (no matter if it's correct): function detectUTF8($text) { return preg_match('%(?: ...

Php Convert to ISO-8859-9

Hello, I use JSON to encode an array, and I get a string like this: {"name":"\u00fe\u00fd\u00f0\u00f6\u00e7"} Now I need to convert this to ISO-8859-9. I tried the following but it fails: header('Content-type: application/json; charset=ISO-8859-9'); $json = json_encode($response); $json = utf8_decode($json); $json = mb_convert_enco...

MySQL ODBC 3.51 Driver UTF-8 encoding

Currently I am migrating MSSQL to MYSQL.I am using the MySQL ODBC 3.51 driver to connect to mysql using odbc connectivity.I have telugu language charectors stored in the table.They are not showing properly while using the mysql odbc driver, but they are showing up properly while using the sqlserver odbc driver. Here is my connetion stri...

How to write a UTF-8 file with Java?

Hi there, I have some current code and the problem is its creating a 1252 codepage file, i want to force it to create a UTF-8 file Can anyone help me with this code, as i say it currently works... but i need to force the save on utf.. can i pass a parameter or something?? this is what i have, any help really appreciated var out = new...

Get file encoding

How can I figure out with PHP what file encoding a file has? ...

NSStream, UTF8String & NSString... Messy Conversion

I am constructing a data packet to be sent over NSStream to a server. I am trying to seperate two pieces of data with the a '§' (ascii code 167). This is the way the server is built, so I need to try to stay within those bounds... unichar asciiChar = 167; //yields @"§" [self setSepString:[NSString stringWithCharacters:&asciiChar length...

What encoding does std::string.c_str() use?

I am trying to convert a C++ std::string to UTF-8 or std::wstring without losing information (consider a string that contains non-ASCII characters). According to http://forums.sun.com/thread.jspa?threadID=486770&amp;forumID=31: If the std::string has non-ASCII characters, you must provide a function that converts from your encoding ...

is htmlspecialchars suficient to escape XML element content in HTTP response?

I'm returning an UTF-8 XML response and some elements have user provided content, so I must ensure they are properly escaped. Is using htmlspecialchars(..., ENT_COMPAT, 'UTF-8') enough for a proper escape of an XML element text? ...

ISO-8859-1 to UTF8 in ASP.NET 2

We've got a page which posts data to our ASP.NET app in ISO-8859-1 <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <title>`Sample Search Invoker`</title> </head> <body> <form name="advancedform" method="post" action="SearchResults.aspx"> <input class="field" name="SearchTextBox" type="text" /...

How to convert Unicode characters to escape codes

So, I have a bunch of strings like this: {\b\cf12 よろてそ } . I'm thinking I could iterate over each character and replace any unicode (Edit: Anything where AscW(char) > 127 or < 0) with a unicode escape code (\u###). However, I'm not sure how to programmatically do so. Any suggestions? Clarification: I have a string like {\b\cf12 よろてそ...

OpenFileDialog filename as UTF8

Hi all, C# question here.. I have a UTF-8 string that is being interpreted by a non-Unicode program in C++.. This text which is displayed improperly, but as far as I can tell, is intact, is then applied as an output filename.. Anyway, in a C# project, I am trying to open this file with an System.Windows.Forms.OpenFileDialog object. ...

reading in utf-8 file (javascript XMLHttpRequest) gives bad european characters

Hi there, can anyone help? I have small procedure to read in an UTF-8 file with javascript using XMLHttpRequest.. this file has european characters like miércoles sábado etc.. Notice the accents.. But when being read in .. the characters are all messed up.. I have checked the file and it is perfect.. it must be the procedure for readin...