comparison libpurple/util.c @ 17161:51f8dac490d7

If we're operating on ASCII characters only, we should use g_ascii_isalnum.
author Richard Laager <rlaager@wiktel.com>
date Sun, 20 May 2007 15:56:53 +0000
parents fdd52f7651c7
children d8102e923bd1
comparison
equal deleted inserted replaced
17160:251ed95cc52c 17161:51f8dac490d7
4210 iter = str; 4210 iter = str;
4211 for (; *iter && j < (BUF_LEN - 1) ; iter = g_utf8_next_char(iter)) { 4211 for (; *iter && j < (BUF_LEN - 1) ; iter = g_utf8_next_char(iter)) {
4212 gunichar c = g_utf8_get_char(iter); 4212 gunichar c = g_utf8_get_char(iter);
4213 /* If the character is an ASCII character and is alphanumeric, 4213 /* If the character is an ASCII character and is alphanumeric,
4214 * or one of the specified values, no need to escape */ 4214 * or one of the specified values, no need to escape */
4215 if (c < 128 && (isalnum(c) || c == '@' || c == '-' || 4215 if (c < 128 && (g_ascii_isalnum(c) || c == '@' || c == '-' ||
4216 c == '_' || c == '.' || c == '#')) { 4216 c == '_' || c == '.' || c == '#')) {
4217 buf[j++] = c; 4217 buf[j++] = c;
4218 } else { 4218 } else {
4219 int bytes = g_unichar_to_utf8(c, utf_char); 4219 int bytes = g_unichar_to_utf8(c, utf_char);
4220 for (i = 0; i < bytes; i++) { 4220 for (i = 0; i < bytes; i++) {