This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Character encoding in MSXML 3.0 from VB



> is there a standard/easy way to translate the window's character value
> to the unicode one? 

The best is to download

http://www.unicode.org/Public/UNIDATA/UnicodeData-Latest.txt

and read 100 lines every night before you go to bed. After a while
you'll just know all the numbers.


> i.e in windows if I type ALT-0145 this display the ' (open quote) how
> do I programmatically know to output this as ‘ 

Ah this is a rather different issue. If you want to type alt-0145
then you will be entering that as character data (ie byte hex 145)
into the file, not ‘. That is OK so long as you tell your XML
parser that you are using this encoding. Ie at the top put
<?xml version="1.0" encoding="xxxxx"?>

Now if you use an encoding other than utf-8 or utf-16 the XML parser is
allowed to reject the file as an unknown encoding. However assuming you
are on MS Windows, most parsers on that platform will presumably
understand these windows encodings.

I think in your case you want  encoding="xxxxx" to be encoding="windows-1252". 
But you might need to check exactly what names your parser calls these
windows encodings.

(You might also wonder why Windows takes the ISO encodings and
gratuitously shuffles the characters round:-)

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]