<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 07/29/2013 07:36 AM, Noah Silva
wrote:<br>
</div>
<blockquote
cite="mid:CANC_V0MCzoOf-nZX-whsXzbmLKeBGZ5W0CQD8TJj5soV3Ft4wg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
class=""><font color="#888888">
<br>
</font></span></blockquote>
<div>Using UTF16 for internal string handling is a sensible
option. <br>
</div>
</div>
</div>
</div>
</blockquote>
It depends.<br>
UTF-16 needs more memory used<br>
Linux OS API in most cases is 8 Bit, while Windows OS API is 16 bit<br>
Conversions are very expensive. <br>
If you need to import export much data but don't do much calculating
of course using the the import/export format all over the place is
sensible. <br>
If you do many calculations, the type of calculation might suggest a
certain encoding.<br>
<br>
<br>
<blockquote
cite="mid:CANC_V0MCzoOf-nZX-whsXzbmLKeBGZ5W0CQD8TJj5soV3Ft4wg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>To address your specific points:</div>
<div>1.Lazarus User API already supports UTF8 so far as I
know.</div>
</div>
</div>
</div>
</blockquote>
I suppose this is bound to change once fpc has completed the move to
"new Delphi Strings". <br>
<blockquote
cite="mid:CANC_V0MCzoOf-nZX-whsXzbmLKeBGZ5W0CQD8TJj5soV3Ft4wg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>2. TStringList could easily support both, but as long
as the conversion to/from other code pages (especially
UTF8) is automatic, I wouldn't mind.</div>
</div>
</div>
</div>
</blockquote>
I already delved into this in another thread here: I do believe that
it is easily possible to invent a string type that supports any
encoding and that can be used to create such a flexible TStringList,
but this needs additional compiler support in an way that is not
anticipated by Delphi. IMHO this is possible without risking
noticeable performance degradation in any of the thinkable
application variants. <br>
<br>
<blockquote
cite="mid:CANC_V0MCzoOf-nZX-whsXzbmLKeBGZ5W0CQD8TJj5soV3Ft4wg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>3. Not sure what class inheritance has to do with
this...</div>
</div>
</div>
</div>
</blockquote>
If you do TSrtingList (in fact TStrings)<font color="#888888"> </font>that
uses this new type in the user-programmer interface it needs to be
possible to derive classes from those that use the fully Delphi
compatible String types with predefined encoding. The compiler
magic needs to be done appropriately to handle this cases,
requesting automatic conversions (only) when necessary. <br>
<br>
-Michael<br>
</body>
</html>