Corinna Vinschen wrote: >Just a hint: > >When on Cygwin, you might better use Cygwin's(*) wcwidth function. It's >based on the same code from Markus Kuhn, but it interacts with the >setlocale function to make sure that the width returned for the CJK >ambiguous width characters makes sense in the given locale. Plus, it >supports a Cygwin-specific locale modifier '@cjknarrow' which allows the >user to modify this behaviour. When using your own wcwidth, you're >giving up on this feature. > >Better yet, convert wide chars to wide strings and use the wcswidth >function. In contrast to wcwidth, it can also handle surrogate pairs.
I don't use surrogates. I only use UTF-8 and UTF-32. But using cygwin's wcwidth may be worth thinking about. I suppose it will be consistent with mintty that way; otherwise not? Using wcswidth isn't very useful in the editor because it has special requirements, like showing control characters with ^C. That's one of the reasons I mostly wrote my own, all the special requirements. I always iterate of bytes, which are converted in a mode-dependent way to ints (UTF-32). Do you have a case-insensitive compare? Because I limited that to ASCII. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple