From 9e5073da15a5359189724b670e5ed19cb6c4b0cb Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 21 Jan 2005 04:41:10 +0000 Subject: several code conversion fix. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@27 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 7 +++++++ ChangeLog.ja | 7 +++++++ src/codeconv.c | 5 +++++ src/codeconv.h | 2 ++ src/compose.c | 2 +- src/html.c | 2 +- src/sourcewindow.c | 5 ++--- src/textview.c | 6 +++--- src/unmime.c | 2 +- 9 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82b44a92..be80727a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,13 @@ 2005-01-21 * src/colorlabel.c: removed include of gdk/gdkx.h. + * src/compose.c: compose_connect_changed_callbacks(): fixed a typo. + * src/codeconv.[ch]: added conv_utf8todisp(). + * src/sourcewindow.c: source_window_append() + src/textview.c: textview_write_line(), textview_write_link() + src/unmime.c: unmime_header() + src/html.c: html_read_line(): assume the encoding of source + string is UTF-8 instead of locale encoding. 2005-01-20 diff --git a/ChangeLog.ja b/ChangeLog.ja index ad3dbcbb..e07830e2 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,6 +1,13 @@ 2005-01-21 * src/colorlabel.c: gdk/gdkx.h の include を削除。 + * src/compose.c: compose_connect_changed_callbacks(): typo を修正。 + * src/codeconv.[ch]: conv_utf8todisp() を追加。 + * src/sourcewindow.c: source_window_append() + src/textview.c: textview_write_line(), textview_write_link() + src/unmime.c: unmime_header() + src/html.c: html_read_line(): ソース文字列を locale + エンコーディングではなく UTF-8 と仮定。 2005-01-20 diff --git a/src/codeconv.c b/src/codeconv.c index 28659b2f..0b73d900 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -782,6 +782,11 @@ void conv_euctodisp(gchar *outbuf, gint outlen, const gchar *inbuf) conv_euctoutf8(outbuf, outlen, inbuf); } +void conv_utf8todisp(gchar *outbuf, gint outlen, const gchar *inbuf) +{ + strncpy2(outbuf, inbuf, outlen); +} + void conv_anytodisp(gchar *outbuf, gint outlen, const gchar *inbuf) { conv_anytoutf8(outbuf, outlen, inbuf); diff --git a/src/codeconv.h b/src/codeconv.h index 7f3fee8c..2d1bf46d 100644 --- a/src/codeconv.h +++ b/src/codeconv.h @@ -189,6 +189,8 @@ CharSet conv_guess_ja_encoding(const gchar *str); void conv_jistodisp (gchar *outbuf, gint outlen, const gchar *inbuf); void conv_sjistodisp (gchar *outbuf, gint outlen, const gchar *inbuf); void conv_euctodisp (gchar *outbuf, gint outlen, const gchar *inbuf); +void conv_utf8todisp (gchar *outbuf, gint outlen, const gchar *inbuf); +void conv_anytodisp (gchar *outbuf, gint outlen, const gchar *inbuf); void conv_ustodisp (gchar *outbuf, gint outlen, const gchar *inbuf); void conv_latintodisp (gchar *outbuf, gint outlen, const gchar *inbuf); void conv_noconv (gchar *outbuf, gint outlen, const gchar *inbuf); diff --git a/src/compose.c b/src/compose.c index ac840b43..7520acf9 100644 --- a/src/compose.c +++ b/src/compose.c @@ -4266,7 +4266,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode) static void compose_connect_changed_callbacks(Compose *compose) { - GtkTextView *text = GTK_TEXT_VIEW(compose->text);; + GtkTextView *text = GTK_TEXT_VIEW(compose->text); GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer(text); diff --git a/src/html.c b/src/html.c index 2c706c94..71c088ac 100644 --- a/src/html.c +++ b/src/html.c @@ -451,7 +451,7 @@ static HTMLState html_read_line(HTMLParser *parser) if (conv_convert(parser->conv, buf2, sizeof(buf2), buf) < 0) { index = parser->bufp - parser->buf->str; - conv_localetodisp(buf2, sizeof(buf2), buf); + conv_utf8todisp(buf2, sizeof(buf2), buf); g_string_append(parser->buf, buf2); parser->bufp = parser->buf->str + index; diff --git a/src/sourcewindow.c b/src/sourcewindow.c index 550e6fb3..64bf30ea 100644 --- a/src/sourcewindow.c +++ b/src/sourcewindow.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2003 Hiroyuki Yamamoto + * Copyright (C) 1999-2005 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,8 +154,7 @@ void source_window_append(SourceWindow *sourcewin, const gchar *str) len = strlen(str) + 1; Xalloca(out, len, return); -#warning FIXME_GTK2 - conv_localetodisp(out, len, str); + conv_utf8todisp(out, len, str); gtk_text_buffer_get_iter_at_offset(buffer, &iter, -1); gtk_text_buffer_insert(buffer, &iter, out, -1); diff --git a/src/textview.c b/src/textview.c index da860bfe..2d5f6754 100644 --- a/src/textview.c +++ b/src/textview.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2004 Hiroyuki Yamamoto + * Copyright (C) 1999-2005 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -941,7 +941,7 @@ static void textview_write_line(TextView *textview, const gchar *str, if (!conv) strncpy2(buf, str, sizeof(buf)); else if (conv_convert(conv, buf, sizeof(buf), str) < 0) - conv_localetodisp(buf, sizeof(buf), str); + conv_utf8todisp(buf, sizeof(buf), str); strcrchomp(buf); //if (prefs_common.conv_mb_alnum) conv_mb_alnum(buf); @@ -997,7 +997,7 @@ void textview_write_link(TextView *textview, const gchar *str, if (!conv) strncpy2(buf, str, sizeof(buf)); else if (conv_convert(conv, buf, sizeof(buf), str) < 0) - conv_localetodisp(buf, sizeof(buf), str); + conv_utf8todisp(buf, sizeof(buf), str); strcrchomp(buf); diff --git a/src/unmime.c b/src/unmime.c index bb9e2822..65d279f6 100644 --- a/src/unmime.c +++ b/src/unmime.c @@ -120,7 +120,7 @@ void unmime_header(gchar *out, const gchar *str) g_free(conv_str); } else { len = strlen(decoded_text); - conv_localetodisp(outp, len + 1, decoded_text); + conv_utf8todisp(outp, len + 1, decoded_text); } outp += len; -- cgit v1.2.3