MacArthur, Ian (SELEX GALILEO, UK) wrote:
>>> http://www.seriss.com/people/erco/fltk/utf8-japanese-songs.cxx
> 
> Oh! One thing I forgot to say - if you have a UTF8 aware text editor,
> you can use that to enter the strings directly in your code.
> You *do not* have to encode them in "raw hex" as Greg did in his
> example.
> 
> I think he only did it that way to make the code robust, so that it can
> be safely viewed and tested on platforms that do not have UTF8 aware
> text editing yet.

        Right, exactly.

        Mainly, so that people can copy/paste from the browser
        without the operation screwing up the utf8 text.

        For instance, on my current workstation, that page doesn't
        show the UTF8 comments correctly in my browser, which likely
        means a copy/paste operation will not bring the utf8 codes
        over correctly.

        The ascii hex codes are guaranteed to be preserved, so that
        a copy/paste problem would not mess up the example when you run it.

> If you are using a proper UTF8 capable text editor, then that problem
> does not arise and you can enter your strings directly in the code.

        Right. Although it's probably safest to get those UTF8 strings
        out of the code, and safely into a language file of some kind.
        It's all too easy to make a quick code change in a utf8 aware
        editor (like VI), but be accidentally logged into a machine that
        doesn't have the utf8 mode turned on, and you loose all your
        utf8 codes in one quick save operation..! Been there/done that!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to