summaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-12-15 15:52:04 +0100
committerSebastian Geerken <devnull@localhost>2012-12-15 15:52:04 +0100
commit2382e62f0e66398f486bb1e9ec7b42b62f34bbef (patch)
tree1e9136ee2560694aac4edc3bb98082f1e2911975 /lout
parent2675076feee501121e300faf17b490572139c54b (diff)
Allow mixing of UTF-8 one one hand, and ISO-8859-1 / ISO-8859-15 / Windows-1252 on the other hand.
Diffstat (limited to 'lout')
-rw-r--r--lout/unicode.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/lout/unicode.cc b/lout/unicode.cc
index 2a147fca..39d3a094 100644
--- a/lout/unicode.cc
+++ b/lout/unicode.cc
@@ -64,7 +64,8 @@ int decodeUtf8 (const char *s)
return ((s[0] & 0x0f) << 18) | ((s[1] & 0x3f) << 12)
| ((s[2] & 0x3f) << 6) | (s[3] & 0x3f);
else
- return '?';
+ // Treat as ISO-8859-1 / ISO-8859-15 / Windows-1252
+ return s[0];
}
@@ -82,7 +83,8 @@ int decodeUtf8 (const char *s, int len)
return ((s[0] & 0x0f) << 18) | ((s[1] & 0x3f) << 12)
| ((s[2] & 0x3f) << 6) | (s[3] & 0x3f);
else
- return '?';
+ // Treat as ISO-8859-1 / ISO-8859-15 / Windows-1252
+ return s[0];
}
const char *nextUtf8Char (const char *s)