summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2009-01-06 10:40:30 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2009-01-06 10:40:30 +0000
commit24fb6a2be0c492b023b32ab98556961a8317e13e (patch)
tree96e3b988b4b49b15f639043bbaf24df1ed4c0a9d /pango
parent12762f0b6df9c0324929feb99fc80406c7501418 (diff)
downloadpango-24fb6a2be0c492b023b32ab98556961a8317e13e.tar.gz
Make it Unicode safe.
2009-01-06 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (pango_font_description_to_filename): Make it Unicode safe. svn path=/trunk/; revision=2786
Diffstat (limited to 'pango')
-rw-r--r--pango/fonts.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 532adbe3..5e145aec 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1280,13 +1280,12 @@ pango_font_description_to_filename (const PangoFontDescription *desc)
result = pango_font_description_to_string (desc);
- /* XXX This should be rewritten to read char-by-char instead
- * of byte-by-byte, to be Unicode safe.
- */
p = result;
while (*p)
{
- if (strchr ("-+_.", *p) == NULL && !g_ascii_isalnum (*p))
+ if (G_UNLIKELY ((guchar) *p >= 128))
+ /* skip over non-ASCII chars */;
+ else if (strchr ("-+_.", *p) == NULL && !g_ascii_isalnum (*p))
*p = '_';
else
*p = g_ascii_tolower (*p);