On Sat, 28 Dec 2013, Jürgen Hestermann wrote:

Am 2013-12-28 11:20, schrieb Marcos Douglas:
file API for example must be implemented in the frameworks.
I think this is an option even in FPC and Lazarus, ie, I see people,
on the future, creating your own "RTL" because FPC and Lazarus do not
agree about Unicode.  :-)

Yes, I already started building my own file management routines
mainly because I was never sure about the string encoding/type
when using the RTL functions.

The current mismanagement regarding strings is a real pain.

There is no mismanagement. The released version is very clear.

The future version (trunk) is not yet clear, but if you are using that,
you should be aware of the risks you decide to take.

We could remove all ansistring support tomorrow, if we felt like it.

Even when looking into documentation there is no information about
which string encoding the routines use/need.
For example, not a single word about string encoding here:
http://www.freepascal.org/docs-html/rtl/sysutils/findfirst.html

For a simple reason: currently, in the released version of FPC, there is no need to document encoding.

The language guide clearly states that in Delphi mode, String = Ansistring.
In ObjFPC mode it is shortstring, unless set to ansistring as well using {$H+}.

So, in both cases 'string' = a single byte string, system codepage.

There is - in the released FPC - no overloaded version with widestrings.

Hence there is no need to document encoding: it is implicit.

As soon as overloaded versions of these functions are released, the codepage/encoding issues will be documented.

Michael.
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to