<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#cccccc" text="#000000">
Florian Klaempfl wrote:
<blockquote cite="mid:48B93106.7020005@freepascal.org" type="cite">I've
continued to work on support of an unicodestring type in fpc. It's
currently in an svn branch at:
<br>
<a class="moz-txt-link-freetext" href="http://svn.freepascal.org/svn/fpc/branches/unicodestring">http://svn.freepascal.org/svn/fpc/branches/unicodestring</a>
<br>
and will be merged later to trunk. The unicodestring type is a ref.
counted utf-16 string. On non-windows, widestring is mapped to this
type. If you're interested in unicode support please test, give
feedback here and submit fixes.
<br>
<br>
An existing working copy of trunk can be switched to this branch by
<br>
cd fpc
<br>
svn switch <a class="moz-txt-link-freetext" href="http://svn.freepascal.org/svn/fpc/branches/unicodestring">http://svn.freepascal.org/svn/fpc/branches/unicodestring</a>
<br>
and back with
<br>
svn switch <a class="moz-txt-link-freetext" href="http://svn.freepascal.org/svn/fpc/trunk">http://svn.freepascal.org/svn/fpc/trunk</a>
<br>
_______________________________________________
<br>
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
<br>
<br>
</blockquote>
<font size="-1"><font face="Helvetica, Arial, sans-serif">The Pascal
huge strings always annoy me.<br>
Since - it is IMPLICIT automatic object with set of overloaded methods,
length and reference count fields etc hidden from developer.<br>
<br>
In near future we geat a Zoo of the strings:<br>
AnsiString, WideString, UnicodeString, ShortString, PWideChar, PChar<br>
Some of them with encoding field.<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">Why
not to make it EXPLICIT object</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
s:=TCoolFPCString.Create('Test');<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">s2:=TCoolFPCString.Create('Проверка');
//UTF8 encoded constant</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">s.asUtf8+=s2;<br>
<br>
SetWindowTextW(WinHandle,s.AsUnicodeString); // i explicitly say - get
me wide string and DO not any compiler magic<br>
<br>
if (s1.length=length(s2))... // generic runtime function length returns
the property of cool object<br>
<br>
s1.AcquireLock // prevent other threads acccess<br>
s1.Clear;<br>
s1.LoadFromResource(n_ReasourceId); // just use GNU gettext<br>
s1.LoadTranslationFromResource(n_resID,'be_BY');<br>
s1.ReleaseLock // allow other thread access<br>
<br>
Anyway I just can subclass standard string and get a new functionality
with reachness of availabel fields and methods.<br>
<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">FPC
supports operators - so there is lots of way to represent the string,
assign the string, load it from resource.<br>
Make it thread-safe at implementation level but not at compiler level.<br>
Standard string, unicode string , ansistring, widestring can be
implemented as wrappers along this object.<br>
It seems like in mseGUI it is done.<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
<br>
</font></font>
</body>
</html>