[vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok)

Cameron Lowell Palmer cameron.palmer at ntnu.no
Wed Jan 21 02:00:20 EST 2015


Don’t forget to check any datasets handed to you that advertise as UTF-16 or UTF-8 because people may have injected mixed codings into the dataset. I’ve encountered that more than once. Really gets you with Norwegian characters æ,ø, and å.

Always good to review on this ugly topic
http://www.joelonsoftware.com/articles/Unicode.html
http://htmlpurifier.org/docs/enduser-utf8.html




On 20. jan. 2015, at 21.43, David Gobbi <david.gobbi at gmail.com<mailto:david.gobbi at gmail.com>> wrote:

On Tue, Jan 20, 2015 at 12:43 PM, Serge Lalonde <serge at infolytica.com<mailto:serge at infolytica.com>> wrote:
Your function ConvertLatin1ToUtf8() works great and now I can at least get the extended ASCII Latin1 encoded characters

You must have noticed that I forgot to declare the string variable "s" in my function :)

My app is actually using managed C++ to glue together the C# GUI with the C++ VTK. This works surprisingly well.
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).

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.

Using vtkUnicodeString, the conversion will be a three-step process:
1) store the Windows unicode string in an "unsigned short" array
2) call from_utf16() to make a vtkUnicodeString
3) call utr8_str() to convert it to UTF--8

I hope this works.  I've never tried it myself.

 - David


_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150121/24160f10/attachment.html>


More information about the vtkusers mailing list