slang-users mailing list

[2013 Date Index] [2013 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] width of UTF-8 text in columbs


Jaap Stolk <jwstolk@xxxxxxxxx> wrote:
> SLutf8_strlen() returns the number of Unicode characters.
> One or more of these Unicode characters could be rendered on the
> screen over 2 columns, for example many Chinese characters.
[...]
> I'm new to slang, so I may have overlooked a simpler solution.
> Has anyone encountered this situation before?

You can use the SLsmg_strwidth function.  Also, the SLwchar_wcwidth
function returns the width of a specified wide character.

--John



[2013 date index] [2013 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]