aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-31 07:07:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-31 07:07:05 +0000
commite76bf3e452d69b606067dbd1fbe8c64b0e2bf8a1 (patch)
tree5d52418890557b28e21f7884a8cfc0e1b51f3c85
parent0d32f61ae924df5815b40c175c535059991a1834 (diff)
replace every non-UTF8 8bit character in the source window etc.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@58 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/codeconv.c5
3 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c430516..1cc18fce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-01-31
+ * src/codeconv.c: conv_utf8todisp(): replace every 8bit character
+ if the source string is not a valid UTF-8.
+
+2005-01-31
+
* src/defs.h: use original ".sylpheed_cache" for CACHE_FILE.
changed CACHE_VERSION to 0x20.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 18c265e9..49029d9c 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
2005-01-31
+ * src/codeconv.c: conv_utf8todisp(): ソース文字列が有効な UTF-8
+ でなければ全ての 8bit 文字を置換するようにした。
+
+2005-01-31
+
* src/defs.h: CACHE_FILE に元の ".sylpheed_cache" を使用。
CACHE_VERSION を 0x20 に変更。
diff --git a/src/codeconv.c b/src/codeconv.c
index 47404702..32b3918f 100644
--- a/src/codeconv.c
+++ b/src/codeconv.c
@@ -788,7 +788,10 @@ static void conv_euctodisp(gchar *outbuf, gint outlen, const gchar *inbuf)
void conv_utf8todisp(gchar *outbuf, gint outlen, const gchar *inbuf)
{
- strncpy2(outbuf, inbuf, outlen);
+ if (g_utf8_validate(inbuf, -1, NULL) == TRUE)
+ strncpy2(outbuf, inbuf, outlen);
+ else
+ conv_ustodisp(outbuf, outlen, inbuf);
}
static void conv_anytodisp(gchar *outbuf, gint outlen, const gchar *inbuf)