I busy to convert characters within a widestring to an xml stream; However I 
encounter problems with 'special characters' e.g. the euro sign.  

Searching for a solution, I did find within the about.delphi.com website:
About Unicode character sets

The ANSI character set used by Windows is a single-byte character set.
Unicode stores each character in the character set in 2 bytes instead
of 1. Some national languages use ideographic characters, which require
more than the 256 characters supported by ANSI. With 16-bit notation we
can represent 65,536 different characters. Indexing of multibyte
strings is not reliable, since s[i] represents the ith byte (not necessarily 
the i-th character) in s.


If you must use Wide characters, you should declare a string variable
to be of the WideString type and your character variable of the
WideChar type. If you want to examine a wide string one character at a
time, be sure to test for multibite characters. Delphi doesn't support
automatic type conversions betwwen Ansi and Wide string types.


Does anyone know how to extract the nth character of type widechar of a 
widestring?

My example:

var
 Value : widestring;
begin
 Value = '€';

examining this example will result in:

Value = '€' > TRUE
but
Value[1] = '€'  FALSE

Conversing widestring character to xml format , i use:
'&#x' + IntToHex(LOrd, 4) + ';'   
Parsing the variable Value
ord(value[1]) will result in 8364  and 
ord(value) will result in 0080 ; 


Any ideas will be welcomed.

Regards

Andries
The Netherlands









 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

[Non-text portions of this message have been removed]

Reply via email to