[PATCH] Fix potentially broken white space truncation on certain Windows versions

Lubomir I. Ivanov neolit123 at gmail.com
Thu Mar 7 11:09:10 PST 2013


On 7 March 2013 21:06, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> On Thu, Mar 7, 2013 at 10:44 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>
>> In Subsurface, usages of string trimming are present in multiple
>> locations, so to make this work try to use GLib's g_unichar_isspace(),
>> given most of the application text is UTF-8. g_ascii_isspace() also
>> works, as it is a locale agnostic version of isspace().
>
> Hmm. I think g_unichar_isspace() is the wrong thing to do. It's not a
> unicode character, it's a byte. So it gives the wrong value for bytes
> that are possibly part of bigger unicode characters (if there is any
> space in the 128-255 area, I didn't check).
>

yes i think that's true.

> g_ascii_isspace() is the right function to use. Or we could just do
> our own and trim all bytes 0 <= x <=32 and be done with it that way
> (but g_ascii_isspace() is likely better)
>

will resubmit a version using g_ascii_isspace() in a minute.

lubomir
--


More information about the subsurface mailing list