Sign in Join

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

Mailing lists / fpc-pascal / 2012-05

Unicode support

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Andrew Brunner

I wanted to ask what the present state of unicode support is now.

I'm running into problems with some various strings. Sometimes when a string contains a unicode character postgresql won't allow the insert/update. Also, some MP3 tags contain UTF16, UTF16BE and I really don't know of the best practice on how to handle multi-byte characters in code.

I have 3 representations of the same string for all ID3 frames for my MP3 tag reader. I have to say - this has become an issue.

Anyone want to comment on direction of FPC for Unicode... Ie I think the string field should be able to re-map to UTF8. Is that something that can be done?

What can I do to support unicode in the serving of pages/files/documents/music without having to have encoding aware code.

http://wiki.freepascal.org/FPC_Unicode_support

Reply by email

Paul Ishenin
to Andrew Brunner
Andrew Brunner wrote
I wanted to ask what the present state of unicode support is now.

Compiler supports AnsiStrings with codepage information and converts them between ansistrings and between other string types with implicit codepage conversion. RawByteString and UTF8String are both supported by compiler too.

For 2 byte encodings compiler has WideString and UnicodeString types.

RTL has only basic support for codepage aware strings and unicodestring type. Most of the code still works with AnsiString.

Show quoted text 5 lines
I'm running into problems with some various strings. Sometimes when a string contains a unicode character postgresql won't allow the insert/update. Also, some MP3 tags contain UTF16, UTF16BE and I really don't know of the best practice on how to handle multi-byte characters in code.

It is difficult to say what is wrong - we don't see the code.

Anyone want to comment on direction of FPC for Unicode... Ie I think the string field should be able to re-map to UTF8. Is that something that can be done?

What string field? Of what class? If you are about string type itself you can use {$H+}, {$codepage UTF-8} and
SetMultiByteConversionCodePage(CP_UTF8) if you want to have string type to be utf8 string in your project.

What can I do to support unicode in the serving of pages/files/documents/music without having to have encoding aware code.

What you want is probably UnicodeString RTL which is not available at the moment.

Best regards,
Paul Ishenin

Reply by email