Hi, 2013/7/9 Jonas Maebe <jonas.ma...@elis.ugent.be>
> > On 09 Jul 2013, at 11:02, Noah Silva wrote: > > 1. What encoding "should" I be writing to the terminal? >> > > The console code page. You can get it using the following function: > function GetConsoleOutputCP : UINT; stdcall; external 'kernel32' name > 'GetConsoleOutputCP'; > > > This is 932 on my system, as expected. http://msdn.microsoft.com/ja-JP/goglobal/cc305152.aspx > from experimenting >> with text files using the cat command in powershell, it seems that local >> ("ANSI") encoding should be used. This makes sense since older versions >> of >> windows only supported local encodings. >> > > The ansi code page is (or at least can be) different, that's the the > result of > function GetACP:UINT; stdcall; external 'kernel32' name 'GetACP'; > > This is also 932, as expected. (I assume they should always be the same though, I don't think most programs check the console output page before writing). > 2. Is there any reason why writing out data in the local encoding (with >> write statements, etc.) should get corrupted? For example is some level >> of >> the RTL assuming something about the encoding? (I don't think so, but...) >> > > 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. > > 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... > Jonas > > Thank you, Noah Silva
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal