<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">2013/7/9 Jonas Maebe <span dir="ltr"><<a href="mailto:jonas.maebe@elis.ugent.be" target="_blank">jonas.maebe@elis.ugent.be</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>
On 09 Jul 2013, at 11:02, Noah Silva wrote:<br>
<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">
1. What encoding "should" I be writing to the terminal?<br>
</blockquote>
<br></div>
The console code page. You can get it using the following function:<br>
function GetConsoleOutputCP : UINT; stdcall; external 'kernel32' name 'GetConsoleOutputCP';<div class="im"><br>
<br></div></blockquote><div><br></div><div>This is 932 on my system, as expected.</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> </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="im">
<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">
from experimenting<br>
with text files using the cat command in powershell, it seems that local<br>
("ANSI") encoding should be used. This makes sense since older versions of<br>
windows only supported local encodings.<br>
</blockquote>
<br></div>
The ansi code page is (or at least can be) different, that's the the result of<br>
function GetACP:UINT; stdcall; external 'kernel32' name 'GetACP';<div class="im"><br></div></blockquote><div>This is also 932, as expected.</div><div>(I assume they should always be the same though, I don't think most programs check the console output page before writing).</div>
<div> </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="im">
<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">
2. Is there any reason why writing out data in the local encoding (with<br>
write statements, etc.) should get corrupted? For example is some level of<br>
the RTL assuming something about the encoding? (I don't think so, but...)<br>
</blockquote>
<br></div>
Not in 2.6.x. In 2.7.x, every ansistring is tagged with a code page (the ansi code page by default) and the RTL will convert it to the console code page before writing it.<div class="im"><br></div></blockquote><div>And I am using 2.6, so it should be clean, yet somehow it's not working out that way. I think I will have to debut writeln... </div>
<div> </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">
Jonas<br><br></blockquote><div>Thank you,</div><div> Noah Silva </div></div><br></div></div>