18861N/A--- gobby-0.4.6/src/encoding.cpp.orig 2007-11-23 21:50:26.000000000 +0900
18861N/A+++ gobby-0.4.6/src/encoding.cpp 2008-09-24 22:11:58.241855000 +0900
18861N/A@@ -41,23 +41,43 @@ Glib::ustring convert_to_utf8(const std:
18861N/A
18861N/A const std::vector<std::string>& Gobby::Encoding::get_encodings()
18861N/A {
18861N/A- static const std::string encodings[] = {
18861N/A- "UTF-8",
18861N/A- "ISO-8859-1",
18861N/A- "ISO-8859-15",
18861N/A- "UTF-7",
18861N/A- "UTF-16",
18861N/A- "UCS-2",
18861N/A- "UCS-4"
18861N/A- };
18861N/A-
18861N/A- static const std::size_t encoding_count =
18861N/A- sizeof(encodings) / sizeof(encodings[0]);
18861N/A-
18861N/A- static std::vector<std::string> encoding_vec(
18861N/A- encodings,
18861N/A- encodings + encoding_count
18861N/A- );
18861N/A+ static std::size_t encoding_count = 0;
18861N/A+ static std::vector<std::string> encoding_vec(encoding_count);
18861N/A+
18861N/A+ if(encoding_count != 0)
18861N/A+ return encoding_vec;
18861N/A+
18861N/A+ static const char *encoding_list =
18861N/A+ /* Translators: the msgid should not be localized.
18861N/A+ * The msgstr is the list of encodings separated by bar. e.g.
18861N/A+ * msgstr "EUC-JP|SHIFT-JIS|ISO-2022-JP|UTF-8|UCS-2|UCS-4" */
18861N/A+ N_("UTF-8|ISO-8859-1|ISO-8859-15|UTF-7|UTF-16|UCS-2|UCS-4");
18861N/A+
18861N/A+ static gchar **encodings = g_strsplit(_(encoding_list), "|", 0);
18861N/A+
18861N/A+ encoding_count = g_strv_length(encodings);
18861N/A+
18861N/A+ encoding_vec.resize(encoding_count);
18861N/A+ for(int i = 0; i < encoding_count; i++)
18861N/A+ encoding_vec[i] = encodings[i];
18861N/A+
18861N/A+ g_strfreev(encodings);
18861N/A+
18861N/A+ static const char* current_encoding = NULL;
18861N/A+ if(!g_get_charset(&current_encoding))
18861N/A+ {
18861N/A+ int i;
18861N/A+ for(i = 0; i < encoding_count; i++)
18861N/A+ {
18861N/A+ if(!strcmp(encoding_vec[i].c_str(), current_encoding))
18861N/A+ break;
18861N/A+ }
18861N/A+ if(i == encoding_count)
18861N/A+ {
18861N/A+ encoding_vec.resize(++encoding_count);
18861N/A+ encoding_vec[encoding_count - 1] = g_strdup(current_encoding);
18861N/A+ }
18861N/A+ }
18861N/A
18861N/A return encoding_vec;
18861N/A }
18861N/A--- gobby-0.4.6/inc/common.hpp.orig 2008-09-24 03:10:59.654015000 +0900
18861N/A+++ gobby-0.4.6/inc/common.hpp 2008-09-24 13:10:23.015627000 +0900
18861N/A@@ -21,6 +21,8 @@
18861N/A
18861N/A #include "net6/gettext_package.hpp"
18861N/A
18861N/A+#define N_(String) (String)
18861N/A+
18861N/A namespace Gobby
18861N/A {
18861N/A