Support for UTF-8

Issue #14 resolved
created an issue

No description provided.

Comments (25)

  1. Anonymous

    I'd like to know more about this issue. What exactly is that Lua doesn't "gracefully" do about utf-8? Do you have samples / links?

  2. Robin Wellner
    • changed status to new

    One way would be to have a String type that can be converted from and to Lua strings, which does handle UTF-8/Unicode without all the problems. It doesn't seem to be the most elegant solution, but if there is no better one...

  3. Dmitry Larchenko

    Yeah, I'm kind of afraid of that, we do want to have standard lua..

    Maybe use some separate resource files with localized (UTF) strings. In code we can use ASCII ID's of that strings...

    Example: love.gettext("Hello") )
  4. Linus reporter

    I think we should just make a love.gettext module with appropriate function, and if you want to use u "Hello", then you can just localize love.gettext.getString (or whatever it will be called) function.

  5. Archinamon

    Would be nice to use something like iconv library. Added the soruce for lua 5.1.4 It works via code:

    require 'iconv/init'
    print(('Кириллица - cyrillic text'):convert('cp1251','utf-8'))

    Supported encodes: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U, KOI8-RU, CP{1250,1251,1252,1253,1254,1257}, CP{850,866}, CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}, Mac{Roman,CentralEurope,Iceland,Croatian,Romania}, Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-7, UCS-2, UCS-2BE, UCS-2LE, UCS-4, UCS-4BE, UCS-4LE, C99, JAVA, UCS-2-INTERNAL, UCS-4-INTERNAL ISO-8859-{6,8}, CP{1255,1256}, CP862, CP864, Mac{Hebrew,Arabic} HP-ROMAN8, NEXTSTEP ARMSCII-8 VISCII, TCVN, CP1258 Georgian-Academy, Georgian-PS EUC-CN, HZ, GBK, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS, ISO-2022-CN, ISO-2022-CN-EXT EUC-KR, CP949, ISO-2022-KR, JOHAB MuleLao-1, CP1133 KOI8-T TIS-620, CP874, MacThai EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-1, ISO-2022-JP-2

    Hope it may be usefull.

  6. Archinamon

    There is good xml-parser (wxXmlDocument) in wxLua (wxWidgets binded to native Lua) with decoding local user file on loading - it could be usefull, i hope.

  7. Meng Jie

    I have a experimental implementation of output utf-8 string in love. It is avaliable in my fork.

    In the implementation, string is just simply treat as a utf-8 string, because utf-8 is compatible with the ANSI(0-127), so in most time it works fine.

    please kindly check it. thanks.

  8. mwchase

    I just got that to compile (if my experience is typical, anyone who can compile the main branch should be able to handle the modified version). What kind of tests should I be running on it? I got Hello World with gratuitous unicode added to work properly, but I assume that stuff like framerate and memory consumption are potential concerns. (Just, generically. Imagine I am utterly unqualified to make any statements about this, because I am.)

    I'm running Snow Leopard on a new MacBook Pro, and there's an outside chance I can bash out binaries for other platforms if anyone else is curious, but has even more trouble compiling than I did. (I make no guarantees about stuff like... compatibility with anything other than my specific architectures, because I'm completely new at anything more advanced than compile-make-make.)

  9. Anonymous

    Two questions about "This is implemented as of r542:4ca613c9690e . Finally."

    1. Can someone please explain to the newbie how to use it?

    2. Does 0.7.1 version(for Windows) includes this? And if not then when?

    Best regards, Anonymous Lover.

  10. Boolsheet

    Dear Anonymous Lover

    UTF8 will be included in LÖVE 0.8.0.
    You can already use it by building the minor branch of this repository yourself, but it's in a early stage right now and probably has some bugs.

    Once you have a running executable you can pass UTF8 strings to

  11. Log in to comment