On Sun, Jan 23, 2005 at 10:34:17PM -0800, Lewis Denizen wrote:
> --- Thomas Leonard <tal00r@...> wrote:
> > OK, fixed now!
> >
> > You need to change this in
> > support.c:collate_key_new():
> >
> > - if
> > (g_unichar_isdigit(g_utf8_get_char(i)))
> > + if
> > (g_ascii_isdigit(g_utf8_get_char(i)))
> >
> > The problem is that g_unichar_isdigit() decided it
> > was a number, but then
> > strtol() didn't understand it.
>
> Hi Thomas, thanks for the quick reply. I fixed
> support.c on line 1175, but it still seems to be dying
> on some specific Japanese characters. I'm still
> getting:
>
> ** (ROX-Filer:25603): CRITICAL **: file
> /var/tmp/portage/rox-2.1.4/work/rox-2.1.4/ROX-Filer/src/support.c:
> line 1187 (collate_key_new): assertion `endp > (char
> *) i' failed
>
> when I have a file with some specific Japanese
> characters in it (for example, a file with the
> character 由 seems to kill ROX-Filer, still).
> The unicode numbers seem to be fixed, but there still
> seems to be some issues with some of the other
> characters.
Oops. g_ascii_isdigit takes a char, not an int like isdigit.
Try this instead:
for (i = name; *i; i = g_utf8_next_char(i))
{
+ gunichar first_char;
+
/* We're in a (possibly blank) text section starting at 'name'.
* Find the end of it (the next digit, or end of string).
+ * Note: g_ascii_isdigit takes char, not unichar, while
+ * g_unicode_isdigit returns true for non ASCII digits.
*/
- if (g_ascii_isdigit(g_utf8_get_char(i)))
+ first_char = g_utf8_get_char(i);
+ if (first_char >= '0' && first_char <= '9')
{
char *endp;
--
Dr Thomas Leonard http://rox.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1
|