News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

XML Encoding

Started by ben2ong2, October 06, 2006, 03:46:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ben2ong2

XML documents may contain foreign characters, like Norwegian æ ø å , or French ê è é.
To let your XML parser understand these characters, you should save your XML documents as Unicode.

Windows 2000 Notepad
Windows 2000 Notepad can save files as Unicode.
Save the XML file below as Unicode (note that the document does not contain any encoding attribute):
<?xml version="1.0"?><note>  <from>Jani</from>  <to>Tove</to>  <message>Norwegian: æøå. French: êèé</message></note>
The file above, note_encode_none_u.xml will NOT generate an error in IE 5+, Firefox, or Opera, but it WILL generate an error in Netscape 6.2.


Windows 2000 Notepad with Encoding
Windows 2000 Notepad files saved as Unicode use "UTF-16" encoding.
If you add an encoding attribute to XML files saved as Unicode, windows encoding values will generate an error.
The following encoding (open it), will NOT give an error message:
<?xml version="1.0" encoding="windows-1252"?>
The following encoding (open it), will NOT give an error message:
<?xml version="1.0" encoding="ISO-8859-1"?>
The following encoding (open it), will NOT give an error message:
<?xml version="1.0" encoding="UTF-8"?>
The following encoding (open it), will NOT generate an error in IE 5+, Firefox, or Opera, but it WILL generate an error in Netscape 6.2.
<?xml version="1.0" encoding="UTF-16"?>



You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login