Re: [xml] Charset trouble



Hello!

I have problem with charsets again ;-(
I'm add in c++
sub_subtree = xmlNewChild(subtree, NULL,(xmlChar*)
"param_value",(xmlChar*)mstring.c_str());

but following error ocure when mstring in KOI8-R charset:

output conversion failed due to conv error
Bytes: 0xC0 0xE1 0xFB 0xEB
xmlOutputBufferWrite: encoder error
output conversion failed due to conv error
Bytes: 0xE1 0xFB 0xEB 0xE0
xmlOutputBufferWrite: encoder error
output conversion failed due to conv error
Bytes: 0xFB 0xEB 0xE0 0xE9
xmlOutputBufferWrite: encoder error
output conversion failed due to conv error
Bytes: 0xEB 0xE0 0xE9 0x20
xmlOutputBufferWrite: encoder error
output conversion failed due to conv error
Bytes: 0xE0 0xE9 0x20 0xCE

How define source charset (like <?xml version="1.0" encoding="koi8-r"?> in
xml file) on xmlNewChild ?
Thanks!

wbr, Abylai

----- Original Message ----- 
From: "Peter Jacobi" <pj walter-graphtek com>
To: "Abylai Ospan" <aospan netup ru>
Sent: Tuesday, October 07, 2003 11:57 PM
Subject: Re: [xml] Charset trouble


Hi Abylai,

I fear you are somewhat on the wrong list for your questions?

But I hope some of your fellow Russians on the list help you nevertheless.

Until their responses arrive:

1. Have looked at http://koi8.pp.ru/framed-koi8.html and generally
speaking googled around to find your answers?

I have some trouble with html-forms contains russian letters. For
example, I
see (using tcpdump) that all available browsers (Opera 5x, Mozilla, IE
6x)
send %D1%85 for russian letter "x" and for all russian letter they send
hex
digits. How to convert this to native KOI8-R Charset ?

2. "%D1%85" is HTML-escaped for "\xD1\x85" which
is UTF-8 encoded U+0445 which is CYRILLIC SMALL LETTER HA,
which seems to be OK.
So you must HTML-decode and then transcode into your preferred
charset, using iconv on Linux or MultiByteToWideChar+
WideCharToMultiByte on Win32.

Or how to tell
browser send form data in KOI8-R ?

3. This seems to be widely broken, according to the
browser comparison table at
http://koi8.pp.ru/framed-koi8.html

Or how to generate html-page using
libxml/libxslt in KOI8-R charset (I've read that only utf-8/16 output
available) ?

4. If compiling with iconv, you can specify every charset you think
of as an output character set.

Regards,
Peter Jacobi
Hamburg, Germany






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]