[fpc-devel] RTL Unicode support, Win32/CE

Yury B. yurybe83 at gmail.com
Tue Aug 5 11:02:11 CEST 2008


The topic has been raised several times, but I have looked through the
sources and documentation and there still are issues for discussion.
First, I'm impressed by the Lazarus project which supports Unicode right
now. It uses utf-8 encoding for this but according to the sources still uses
simple AnsiString or just String types for storage. I'm very concerned of
the tight and simple integration of LCL and RTL/FCL and see the page in wiki
which tells to use Utf8ToAnsi convertion function for calls to RTL, to link
properly the LCL and RTL. So, calling each time a conversion function is
inconvenient.

Second, i haven't found any WideString or UTF8String typed standard file IO
functions in the RTL that makes impossible to deal with files whose names
contain national symbols not represented by the ANSI code page set in the
Win32 for *A functions. (e.g. saving a french web page containing symbols
with accents under a cyrillic-localized version of WinNT as a file whose
name is the title of the page)

SUMMARY: Even if LCL supports unicode display, the RTL cannot deal with
unicode filenames under Win32.

As far as i know, the problem concerns Win32 and WinCE only, i.e. Linux and
MacOS use UTF- 8 as system encoding nowadays.

PROPOSAL: Make UTF-8 the default encoding (i.e. emulate it) for the FPC RTL
under Win32 (NT-based versions) and make conversion at place where
unicode-enabled system calls are needed, e.g. FileOpen/Create, FindFirst
etc. No separate NT-only RTL is required for this.

Any ideas? I would like to do some work towards this if the solution is
approved by masses.

Also any help is appreciated: 1) the list of string-related functions to
change; 2) next char, previous char functions to skip 3-4 bytes of UTF-8
encoded character; 3) are there any locale calendar/date-time functions
which return the name of the month, day?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080805/f17f189e/attachment.html>


More information about the fpc-devel mailing list