<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">2013/7/9 Marco van de Voort <span dir="ltr"><<a href="mailto:marcov@stack.nl" target="_blank">marcov@stack.nl</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">In our previous episode, Dennis Poon said:<br>
> Please state the windows version you are using. XP or Windows 7?<br>
<br>
</div>In XP there were separate Far East versions of Windows. In Vista+ this<br>
was wholly integrated and there is only one Vista base system with various<br>
language packs.<br>
<br></blockquote><div style>This is basically true. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It might be that some of the Far East apis were deprecated later, but I<br>
would expect them to run if you configure the backwards compatibility<br>
options on the shortcut.<br>
<div class="im"><br></div></blockquote><div style>There aren't many "far east APIs", basically everything just used a local variable length (multi byte) encoding that works similarly to UTF8 but only supports local characters. For the most part, none of the system APIs cared what was in a string, they just plastered it somewhere. Since 1 byte <> 1 char, but normal code didn't know that, you were safe with things like Concat, but couldn't safely do things like copy(string,3,4) and expect it to work. That's still a problem with FreePascal, but in general, things like Copy() can work with all character sets not only because of unicode. Anything fancy that had to be done before was almost always at the application layer.</div>
<div style><br></div><div style>Anyway, if Windows changed the encoding from "local" to UTF8 suddenly, every single Japanese program that outputs SJIS to the command-line would break. In the GUI it is a little different because the system "knows" if the programs are Unicode or non-Unicode, and there is a setting as to what encoding to use for non-unicode apps.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> I deal with chinese in my programs so I know your problems. The same<br>
> delphi 5 program works differently on XP and Windows 7. Looks like<br>
> Windows 7 has removed support for non unicode (I am not sure whether the<br>
> Unicode it uses is UTF8, UTF16 or UTF32).<br></div></blockquote><div><br></div><div style>This is definitely not the case, plenty of non-unicode programs work on Windows 7. They would face a huge revolt.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
</div>UTF16 and a bit of UTF8. (e.g. notepad groks utf8 now).<br>
<div class="im"><br></div></blockquote><div style>Finally, not if only Excel could save UTF8 or handle UTV8 CSV files...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
> Seems that all filenames in XP are treated as unicode code.<br>
<br>
</div>All NT derived systems are Unicode (UCS2, later UTF16) in the heart. The<br>
whole ansi support is a win32 compatibility layer.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div>Yes, which is amazing, since in many places there is no unicode support in user space. <br></div><div style>You click on a CSV file and Excel needs it to be SJIS (or whatever), even though I am sure modern versions of excel are storing it as UTF16 internally anyway.</div>
<div style><br></div><div style>Sadly it doesn't really matter how good NT is if everything uses the Win32 layer. (I heard the NT kernel supported hard links and multiple mount points like Unix too...)</div><div style>
<br></div><div style>At any rate, it would be nice if we can have FreePascal libraries talk directly to the Unicode interfaces (even the win32 ones), instead of local interfaces where possible. Besides being easier, it would be more reliable. </div>
<div style><br></div><div style>Some how I ended up spending 14 hours at work today (a Sunday!), so I didn't have a chance to look at the hints given by others yet, but tomorrow... I may make something like a ConsoleWriteln(const s:UTF8String) function that "just Works" to the extent possible.</div>
<div style><br></div><div style>Thank you,</div><div style> Noah Silva</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
_______________________________________________<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>