OK, I solved this one. Indeed the problem was gchar (i.e. signed) - which was treated as less-than-zero when it run into this stupid bit of code:
if ((spnew[i] < 32) && ((spnew[i] != 9) && (spnew[i] != 10) && (spnew[i] != 13))) spnew[i] = 32;
which was meant to replace control chars with spaces, but ended up replacing all non-ascii chars with spaces when used with gchar instead of guchar.
I'll now rewrite this brain damage properly, using g_unichar_iscntrl().
From: "bulia byak" <archiver_1@...19...> To: inkscape-devel@lists.sourceforge.net Subject: [Inkscape-devel] non-ASCII chars Date: Tue, 09 Dec 2003 05:36:50 +0000
I have merged the interesting parts of 0.33's sp-text.c and text-context.c, but this did not help with the cyrillic chars being untypeable. I started to dig into this specifically and now I have a strong suspicion that the culprit is the inkscape's change from guchar to gchar in functions that insert new chars into the string as they are typed. I cannot test it quickly because it requires changing in lots of places (and they cannot be simply cast, at least not with g++), but this seems likely. For example sp_text_insert used to receive the char to insert as a guchar, but now it gets gchar. As it is supposed to be in UTF8, perhaps the encoding goes wrong and the result is the space characters in the string (or at least something that looks like spaces).
So:
Does anyone else think that guchar/gchar replacement could break this?
Why was this replacement necessary in the first place?
Is it OK if I reverse it in the text code?
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%...
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
_________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2f...