<div class="gmail_quote">On Sun, Jun 14, 2009 at 1:08 PM, Zachary Turner <span dir="ltr">&lt;<a href="mailto:divisortheory@gmail.com">divisortheory@gmail.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><div></div><div class="h5">An application I currently work on is stricken with this.  If (like</div></div>
us) you are just trying to provide basic internationalization across<br>
Windows and Linux and want it to &quot;just work&quot; and be simple, then I<br>
would suggest typedefing something like<br>
<br>
typedef std::wstring utf_string;<br>
typedef boost::filesystem::wpath utf_path;<br>
typedef wchar_t utf_char;<br>
<br>
etc on windows, and<br>

<br>
typedef std::string utf_string;<br>
typedef boost::filesystem::path utf_path;<br>
typedef char utf_char;<br>
<br>
on Linux.  Then just use a simple UTF-8 &lt;-&gt; UTF-16 conversion if ever<br>
you need to persist / retrieve something, so that it&#39;s stored in a<br>
common format.  We&#39;re getting many strange problems relating to<br>
locales when we try to use UTF-16 in wpaths on Linux, and if it&#39;s not<br>
too much effort it&#39;s going to be simpler to just have your program<br>
always store them in the native format that the OS is expecting.</blockquote><div><br></div><div>Great advice Zach. I&#39;ll definitely do this. However, it would be nice to have an already-made conversion routine for UTF8 to UTF16. I&#39;m hoping that most of the cases where I&#39;m converting encodings will be when I&#39;m going through another library where it has already been handled, like wxWidgets or boost. </div>
</div>

