<div dir="ltr">Hello everyone, <div class="gmail_extra"><br><div>OK I have checked this out:</div><div class="gmail_quote">2013/7/9 Tomas Hajny <span dir="ltr"><<a href="mailto:XHajT03@hajny.biz" target="_blank">XHajT03@hajny.biz</a>></span><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"><div class="im"><br></div>There is code page 65001 for UTF-8, however I don't know since which<br>
version of MS Windows it is supported (and to which extent - e.g.<br>
including the console output). You may change the output code page for<br>
console using the Windows API call SetConsoleOutputCP, but e.g. our unit<br>
Crt currently resets the code page used for output to console to the<br>
"main" process code page (as returned by GetACP) on each write and thus<br>
ignores the user selection - this will probably change in trunk in the<br>
future as part of the Unicode support activities, but the current state is<br>
like this.<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>According to MSDN, GetACP returns ANSI code page (i.e. never Unicode pages CP_UTF8)<br></div><div>On my system, the codepage it returns is 932 (SJIS), so writing SJIS to the console should be no issue, even is writeln resets the code page every time. </div>
<div><br></div><div><a href="http://msdn.microsoft.com/ja-JP/goglobal/cc305152.aspx">http://msdn.microsoft.com/ja-JP/goglobal/cc305152.aspx</a><br></div><div><br></div><div>Yet, doing the following yields garbage:</div><div>
<div> Writeln(UTF8ToANSI(Object.Text));</div></div><div><br></div><div>(and I have verified that the Text field content is indeed in UTF8 format).</div><div><br></div><div>As for my FPC version:</div><div>Lazarus 1.1</div>
<div>2012-11-06</div><div>FPC 2.6.1</div><div>SVN 37432</div><div>x86_64-win64-win32/win64</div><div><br></div><div>(I have various other versions installed, but all on OS X machines...)</div><div><br></div><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">
Tomas<br>
</font></span><div class=""><div class="h5"><br></div></div></blockquote><div> thank you,</div><div> Noah Silva </div><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">
<div class=""><div class="h5">
<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br></div></div>