<div dir="ltr">This is now in HEAD.<div><br></div><div>Enjoy!</div><div style>Max</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 23 April 2013 21:29, Max Bolingbroke <span dir="ltr">&lt;<a href="mailto:batterseapower@hotmail.com" target="_blank">batterseapower@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi GHCers,<div><br></div><div>I&#39;ve implemented support in GHC for extra Windows code pages on the branch &quot;dbcs&quot; of the base library.</div>
<div><br></div><div>The problem this solves is that currently users of Haskell on a Windows machine running in a locale which uses a double-byte code page such as CP936 (GBK) or CP950 (Big5) cannot properly interact with the Windows console in their native language. Unfortunately code page support is a prerequisite for getting this to work correctly because for all Microsoft&#39;s fine talk about Unicode being the future, the Windows console does not seem to support it properly - code pages are the only way to go for console input and output.</div>

<div><br></div><div>As the standard Windows locale encodings in many regions, these code pages are also the predominant method of encoding text files in many countries, so they are useful outside the console.</div>
<div><br></div><div>The solution is along the lines suggested in <a href="http://hackage.haskell.org/trac/ghc/ticket/3977" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/3977</a>, i.e. we create an iconv-like interface to Window&#39;s MultiByteToWideChar and WideCharToMultiByte APIs by the judicious use of binary search. In my branch, these APIs will be used whenever we don&#39;t have a built-in native Haskell TextEncoding for the code page (we used to fall back on using latin1 for such code pages).</div>

<div><br></div><div>Unless there are any objections I&#39;ll merge this into the base library main branch next week.</div><div><br></div><div>Cheers,</div><div>Max</div></div>
</blockquote></div><br></div>