<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 20, 2014 at 1:21 PM, Mattias Gaertner <span dir="ltr"><<a href="mailto:nc-gaertnma@netcologne.de" target="_blank">nc-gaertnma@netcologne.de</a>></span> wrote:<br><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">Hi all, especially Windows users,<br>
<br>
The development version of FPC 2.7.1 has extended Strings and many RTL<br>
functions now work for codepages other than the system codepage.<br>
<br>
This means Lazarus can now be compiled in two modes:<br>
<br>
1. The old mode: LCL treats all "String" as UTF-8 encoded. When<br>
accessing RTL and WinAPI functions you have to use the UTF8 functions.<br>
For example aStringList.LoadFromFile(UTF8ToSys(Filename)) and<br>
FileExistsUTF8. Note that UTF8ToSys only supports characters in the<br>
Windows code page, while FileExistsUTF8 supports the full Unicode range.<br>
<br>
2. The new mode: The LCL, FCL and RTL treat all "String" as UTF-8<br>
encoded. Most RTL file functions now work with full Unicode.<br>
For example FileExists and aStringList.LoadFromFile(Filename) now<br>
support full Unicode.<br>
AnsiToUTF8, UTF8ToAnsi, SysToUTF8, UTF8ToAnsi have no effect. Many<br>
UTF8Encode and UTF8Decode calls are no longer needed, because when<br>
assigning UnicodeString to String and vice versus the compiler does it<br>
automatically for you.<br>
When accessing the WinAPI you must use the W functions or use<br>
UTF8ToWinCP and WinCPToUTF8.<br>
You can enable the new mode by compiling Lazarus clean with<br>
-dEnableUTF8RTL.<br>
<br>
More information about the new FPC Unicode Support:<br>
<a href="http://wiki.freepascal.org/FPC_Unicode_support" target="_blank">http://wiki.freepascal.org/FPC_Unicode_support</a><br>
<br>
RTL functions that now support Unicode under Windows:<br>
<a href="http://wiki.freepascal.org/FPC_Unicode_support#RTL_changes" target="_blank">http://wiki.freepascal.org/FPC_Unicode_support#RTL_changes</a><br>
<br>
The above links are about the default RTL with system code page.<br>
I want to create a Wiki page to gather all information about<br>
the UTF8 RTL for Lazarus users and how to adapt their code.<br>
<br>
Please test and tell what you find out.<br>
<br>
<br>
Mattias</blockquote></div><div><br></div><div>The best news of the year! \o/ \o/ \o/<br></div><div><br></div><div>Thanks thanks thanks Lazarus/FPC team! (y)</div><div><br></div>-- <br><div class="gmail_signature">Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>