[EMAIL PROTECTED] wrote on 2004-08-12 18:23 UTC: > If you want to use UTF-8, you're pretty much done! Just work with the > UTF-8 strings just like any other string. Just remember to use wcslen() > instead of strlen() if you want the number of characters. This is > particularily important when doing formatting for a curses app.
For screen layout purposes, don't you really want to use wcswidth() instead of wcslen()? The former gives you the number of character cells that a string will move the cursor forward on a typical UTF-8 terminal, the latter gives you merely the number of characters, each of which may consume 0, 1, or 2 character cells. Markus -- Markus Kuhn, Computer Lab, Univ of Cambridge, GB http://www.cl.cam.ac.uk/~mgk25/ | __oo_O..O_oo__ -- Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/
