lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi, list!

$ lua -l unicode
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> =unicode.utf8.format("|%5s|", "12345")
|12345|
> return unicode.utf8.format("|%5s|", "12")
|   12|
> return unicode.utf8.format("|%5s|", "абвгд")
|абвгд|
> return unicode.utf8.format("|%5s|", "абв")
|абв|
> return unicode.utf8.format("|%5s|", "аб")
| аб|

It seems that length in bytes is used instead of length in characters.

Judging from the code here, string is simply formatted using
non-unicode-aware s[n]printf:

https://github.com/LuaDist/slnunicode/blob/master/slnunico.c#L1227

Is there some place better than the Lua ML where I can report this
problem so it can be fixed? :-)

Best,
Alexander.