<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On Nov 25, 2010, at 5:01 PM, Jochen Wilhelmy <<a href="mailto:j.wilhelmy@arcor.de">j.wilhelmy@arcor.de</a>> wrote:</span><br></div><div><br></div><div></div><blockquote type="cite"><div><span>Hi!</span><br><span></span><br><span>Of course nobody wants to implement unicode support for windows</span><br><span>because windows should support an utf8-locale and windows is obsolete</span><br><span>anyway ;-)</span><br><span></span><br><span>But there is a simple solution: use boost::filesystem::path everywhere you</span><br><span>use file names and paths, for example in clang::FileManager::getFile.</span><br><span>With version 3 opening a file is easy: std::fstream file(path.c_str()).</span><br><span>Internally boost::filesystem::path uses the native encoding which is</span><br><span>utf16 for windows but you won't notice it since it recodes 8 bit strings</span><br><span>automatically (which is no-op on unix and macos).</span><br><span></span><br><span>If you don't want to become dependent on boost, I suggest reimplementing</span><br><span>the most important features always using 8 bit strings and then have </span><br><span>something</span><br><span>like this:</span><br><span></span><br><span>#ifdef HAVE_BOOST</span><br><span>namespace fs = boost::filesystem;</span><br><span>#else</span><br><span>// simple implementation here</span><br><span>#endif</span><br><span></span><br><span>-Jochen</span><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#0023A3"><br></font></font></div></blockquote><br><div>This happens to be very close to the code I'm working on now (I assume this post was prompted by my patches). I'll be adding unicode support to the Windows implementation, however, paths will remain utf-8 encoded outside of System.</div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">I really wish UCS-2 never existed ;/.</span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">- Michael Spencer</span></div><div><br></div></body></html>