<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 20, 2015 at 12:43 PM, Serge Lalonde <span dir="ltr"><<a href="mailto:serge@infolytica.com" target="_blank">serge@infolytica.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    Your function ConvertLatin1ToUtf8() works great and now I can at
    least get the extended ASCII Latin1 encoded characters</div></blockquote><div><br></div><div>You must have noticed that I forgot to declare the string variable "s" in my function :)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    My app is actually using managed C++ to glue together the C# GUI
    with the C++ VTK. This works surprisingly well.<br>
    The "problem" (if you can call it that) is that C# strings are
    stored internally in Unicode. Some of the text we'd like to display
    is not available in the Latin1 encoding (ex: special unit symbols).</div></blockquote><div><br></div><div>If I recall correctly, Windows uses UTF-16 as its native "unicode" encoding (always stored as wchar_t).  So you need something to convert UTF-16 to UTF-8.</div><div><br></div><div>Using vtkUnicodeString, the conversion will be a three-step process:</div><div>1) store the Windows unicode string in an "unsigned short" array</div><div>2) call from_utf16() to make a vtkUnicodeString</div><div>3) call utr8_str() to convert it to UTF--8</div><div><br></div><div>I hope this works.  I've never tried it myself.</div><div><br></div><div> - David</div><div><br></div><div><br></div></div></div></div>