Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

GB18030 support in Lazarus

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Tony Whyman
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

Reply by email

Tony Whyman
to Mattias Gaertner

"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

Mattias Gaertner wrote 19 lines
On Fri, 16 Oct 2015 09:31:47 +0100 Tony Whyman wrote: > 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 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Tony Whyman
"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

Reply by email

Martin Frb
to Tony Whyman: "Work": It was intended as a general question as I am trying to understand where the…
Tony Whyman wrote
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?

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.

Reply by email

Mattias Gaertner
to Martin Frb
Show quoted text 9 lines
On 16/10/2015 10:19, Tony Whyman wrote: > > 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? 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.

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

Reply by email