summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Wong <gtw@gnu.org>2010-03-25 21:59:28 -0600
committerGary Wong <gtw@gnu.org>2010-03-25 21:59:28 -0600
commit260a44476aea0912c28a71dbc92bc9fdfc83b76b (patch)
treee2688914e2a167eb784f759e5c2d1678b5230a3b
parentb31ed8da98a0780e8199d7fc00180d14b26bac06 (diff)
Fix ISO 8859-1 to UTF-8 conversion.
-rw-r--r--ChangeLog4
-rw-r--r--utf8.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e42ad7f..9eb0af2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-25 Gary Wong <gtw@gnu.org>
+
+ * utf8.c (to_utf8): Fix ISO 8859-1 to UTF-8 conversion.
+
2009-12-06 Gary Wong <gtw@gnu.org>
* root.c (root_reparent_notify): Handle cases where a window is
diff --git a/utf8.c b/utf8.c
index d05e652..d1eb4e0 100644
--- a/utf8.c
+++ b/utf8.c
@@ -91,8 +91,8 @@ extern char *to_utf8( enum gwm_encoding encoding, const char *in,
for( ; len; len-- )
if( *in & 0x80 ) {
- *outp++ = 0xC0 | ( *in >> 6 );
- *outp++ = 0x80 | ( *in & 0x3F );
+ *outp++ = 0xC0 | ( (const unsigned char) *in >> 6 );
+ *outp++ = 0x80 | ( *in++ & 0x3F );
} else
*outp++ = *in++;