<br><br><div class="gmail_quote">On Sat, Jun 19, 2010 at 1:06 AM, Roman Cheplyaka <span dir="ltr">&lt;<a href="mailto:roma@ro-che.info">roma@ro-che.info</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
While ghc 6.12 finally has proper locale support, core packages (such as<br>
unix) still use withCString and therefore work incorrectly when argument<br>
(e.g. file path) is not ASCII.<br></blockquote><div><br></div><div>Pardon me if I&#39;m misunderstanding withCString, but my understanding of unix paths is that they are to be treated as strings of bytes.  That is, unlike windows, they do not have an encoding predefined.  Furthermore, you could have two filepaths in the same directory with different encodings due to this.</div>
<div><br></div><div>In this case, what would be the correct way of handling the paths?  Converting to a Haskell String would require knowing the encoding, right?  My reasoning is that Haskell Char type is meant to correspond to code points so putting them into a string means you have to know their code point which is different from their (multi-)byte value right?</div>
<div><br></div><div>Perhaps I have some details wrong?  If so, please clarify.</div><div><br></div><div>Jason</div></div>