Does anyone know if the lazutf8 functions also work with GB18030 (Chinese character set)?
Tony Whyman
MWA

Mailing lists / lazarus / 2015-10
6 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Does anyone know if the lazutf8 functions also work with GB18030 (Chinese character set)?
Tony Whyman
MWA
Does anyone know if the lazutf8 functions also work with GB18030 (Chinese character set)?
Please define "work".
The LazUTF8 supports the full UTF-8 encoding, which afaik is enough to support all characters in GB18030.
Do you only mean the unit LazUTF8 or also lconvencoding or the LCL?
Mattias
"Work": It was intended as a general question as I am trying to understand where the differences are between UTF8 and GB18030, and whether there is explicit support in Lazarus for GB18030, or if it is a case of "Lazarus should support GB18030 because it supports UTF8".
In terms of "work", if I use functions such as UTF8Length and ValidUTF8String on a GB18030 string should they always work, or are there exceptions?
I am less concerned with character set Whyman
MWA
"Work": It was intended as a general question as I am trying to understand where the differences are between UTF8 and GB18030, and whether there is explicit support in Lazarus for GB18030, or if it is a case of "Lazarus should support GB18030 because it supports UTF8".
The latter.
In terms of "work", if I use functions such as UTF8Length and ValidUTF8String on a GB18030 string should they always work, or are there exceptions?
They only check the encoding. They don't check for codepoints, which are not yet defined by the Unicode Standard.
I am less concerned with character set
"Work": It was intended as a general question as I am trying to understand where the…
Tony Whyman wroteIn terms of "work", if I use functions such as UTF8Length and ValidUTF8String on a GB18030 string should they always work, or are there exceptions?
IIRC ... UTF8Length counts codepoints, not chars. So if the chars you are interested in have chars that need more than one codepoint then this is not the length in char.
This can even happen with some western languages, but it is not likely with them.
The same is for char accessing function (NextUtf8CharByteLen or similar). They only get codepoints.
True.
This can even happen with some western languages, but it is not likely with them.
Actually decomposed characters are pretty common in western languages, for example on OS X HFS+. And afaik Chinese in Unicode usually use precomposed characters, does it not?
The same is for char accessing function (NextUtf8CharByteLen or similar). They only get codepoints.
Mattias