iso-8859-1

Writing XML files using XmlTextWriter with ISO-8859-1 encoding (C#)

I'm having a problem writing Norwegian characters into an XML file using C#. I have a string variable containing some Norwegian text (with letters like æøå). I'm writing the XML using an XmlTextWriter, writing the contents to a MemoryStream like this: MemoryStream stream = new MemoryStream(); XmlTextWriter xmlTextWriter = new XmlTextW...

Setting ISO-8859-1 encoding for a single Tapestry 4 page in application that is otherwise totally UTF-8

I have a Tapestry application that is serving its page as UTF-8. That is, server responses have header: Content-type: text/html;charset=UTF-8 Now within this application there is a single page that should be served with ISO-8859-1 encoding. That is, server response should have this header: Content-type: text/html;charset=ISO-8859-1 ...

Setting the character encoding in form submit for Internet Explorer

I have a page that contains a form. This page is served with content type text/html;charset=utf-8. I need to submit this form to server using ISO-8859-1 character encoding. Is this possible with Internet Explorer? Setting accept-charset attribute to form element, like this, works for Firefox, Opera etc. but not for IE. <form accept-cha...

What content encoding does a Perl CGI script use by default?

Hi there, I'm modifying a mature CGI application written in Perl and the question of content encoding has come up. The browser reports that the content is iso-8859-1 encoded and the application is declaring iso-8859-1 as the charset in the HTTP headers but doesn't ever seem to actually do the encoding. None of the various encoding tec...

Any way to convert a regular string in ActionScript 3 to a ByteArray of Latin-1 Character Codes?

I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3? ...

How to write out a text file in C# with a code page other than utf-8?

I want to write out a text file. Instead of the default UTF-8, I want to write it encoded as ISO-8859-1 which is code page 28591. I have no idea how to do this... I'm writing out my file with the following very simple code: using (StreamWriter sw = File.CreateText(myfilename)) { sw.WriteLine("my text..."); sw.Close(); } ? ...

Convert utf8-characters to iso-88591 and back in PHP

Hi all. Some of my script are using different encoding, and when I try to combine them, this has becom an issue. But I can't change the encoding they use, instead I want to change the encodig of the result from script A, and use it as parameter in script B. So: is there any simple way to change a string from UTF-8 to ISO-88591 in PHP...

Java App : Unable to read iso-8859-1 encoded file correctly.

I have a file which is encoded as iso-8859-1, and contains characters such as ô . I am reading this file with java code, something like: File in = new File("myfile.csv"); InputStream fr = new FileInputStream(in); byte[] buffer = new byte[4096]; while (true) { int byteCount = fr.read(buffer, 0, buffer.leng...

encoding discrepancy between "main" page and dojo dialog

I have a strange encoding situation, whereby the html page itself displays as it should (with all the accénted chäracters properly displayed), but all the popup dojo dialogs fail to use the correct encoding. Here is the setup: Java web project with Hibernate/Spring/Struts2 running on Tomcat6.0.18; the pages are generated as JSP tiles,...

HTML entities and charset in IE

I am displaying html entity &#10003; (a check mark: ✓) in an html document that uses iso-8859-1 for the character set. In Firefox, it displays as a check mark. In IE, it displays as a square box. Switching to UTF-8 doesn't seem to make a difference. Is there a reliable way to display these entities in IE 6 & 7 without using images? ...

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 (J2ME), but I want to preserve the special chars and get the string from the RMS but with the ISO-8859-1 encoding. How do I do this? ...

Converting UTF-8 to ISO-8859-1 in Java - how to keep it as single byte

Hi, I am trying to convert a string encoded in java in UTF-8 to ISO-8859-1. Say for example, in the string 'âabcd' 'â' is represented in ISO-8859-1 as E2. In UTF-8 it is represented as two bytes. C3 A2 I believe. When I do a getbytes(encoding) and then create a new string with the bytes in ISO-8859-1 encoding, I get a two different char...

Another JQuery encoding problem, on IE

Hi all, I'm coding an italian website where I need to validate some input data with an xhr call. My code for the ajax request's like this (I'm using JQuery 1.3.2): $.ajaxSetup({ type: "POST", timeout: 10000, contentType: "application/x-www-form-urlencoded; charset=iso-8859-1" }); $.ajax({ url: "ajaxvalidat...

iconv gives "Illegal Character" with smart quotes -- how to get rid of them?

I have a MySQL table with 120,000 lines stored in UTF-8 format. There is one field, product name, that contains text with many accents. I need to fill a second field with this same name after converting it to a url-friendly form (ASCII). Since PHP doesn't directly handle UTF-8, I'm using: $value = iconv ('UTF-8', 'ISO-8859-1', $value)...

problems reading CDATA section with special chars (ISO-8859-1 encoding)

I am trying to read a xml stream and load it into a collection. This works but Im having difficulties reading special chars. E.g. if my xml looks like this <?xml version="1.0" encoding="ISO-8859-1" ?> <persons> <person> <firstname> <![CDATA[ Sébastien ]]> </firstname> <lastname> <![CDATA[Ørvåk]]> </lastname> </person> </...

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" /...

Problem with libxml character enconding on win32

While parsing some html files with libxml the function xmlParseFile() returns that the code includes non UTF-8 characters How can i modify the default charset of the library to ISO-8859-1 ? Is there any other way to solve this ? PS: The entire development is based on libxml and works in most cases so I can't switch to another library. ...

Converting UTF-8 to ISO-8859-1 in Java

I am reading an XML document (UTF-8) and ultimately displaying the content on a Web page using ISO-8859-1. As expected, there are a few characters are not displayed correctly, such as “, – and ’ (they display as ?). Is it possible to convert these characters from UTF-8 to ISO-8859-1? Here is a snippet of code I have written to attempt...

How to get json_encode() to work with ISO-8859-1 (åäö)

json_encode() wont work for me when I'm using åäö. Why? And how can I get it to work? The php: echo json_encode($arr); The javascript: var theResponse = JSON.parse(xmlHttp.responseText); When I alert() the response, and the response contains å, ä or ö, the response is = NULL Please, help me out... ...

Which code set is /etc/passwd stored in? Can it be UTF-8? What limits are placed on user names?

On a modern Unix or Linux system, how can you tell which code set the /etc/passwd file stores user names in? Are user names allowed to contain accented characters (from the range 0x80..0xFF in, say, ISO 8859-1 or 8859-15)? Can the /etc/passwd file contain UTF-8? Can you tell that it contains UTF-8? What about the plain text of passwo...