RE: [xml] UTF8Toisolat1() usage



Henke, Markus writes:

An (out-) buffer that's convertet
from UTF-8 to ISO-8859-1 will never need more than twice the space
as the corresponding in-buffer.

Though this isn't wrong, the effect is the other way round:

A conversion from UTF8 to Latin1 may only shorten the text (down to
the half of the utf8 byte length in extreme cases).
So allocating a buffer of the size of the UTF8 text will be sufficiant.

If you convert Latin1 to UTF8 the text might need up to twice the space.

        Morus



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