From 67388bc8f489370792031bb7fca11eed20dcd416 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 10 Feb 2011 06:14:05 +0000 Subject: return correct locale encoding for Mac OS X (usually UTF-8). git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2842 ee746299-78ed-0310-b773-934348b2243d --- libsylph/codeconv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libsylph') diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index a71af5a0..b30bd910 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2007 Hiroyuki Yamamoto + * Copyright (C) 1999-2011 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1696,6 +1696,8 @@ static const struct { {"ja_JP.JIS" , C_ISO_2022_JP , C_ISO_2022_JP}, #ifdef G_OS_WIN32 {"ja_JP" , C_CP932 , C_ISO_2022_JP}, +#elif defined(__APPLE__) + {"ja_JP" , C_UTF_8 , C_ISO_2022_JP}, #else {"ja_JP" , C_EUC_JP , C_ISO_2022_JP}, #endif @@ -1943,7 +1945,7 @@ CharSet conv_get_locale_charset(void) static CharSet cur_charset = -1; const gchar *cur_locale; const gchar *p; -#ifndef G_OS_WIN32 +#if !defined(G_OS_WIN32) && !defined(__APPLE__) gint i; #endif S_LOCK_DEFINE_STATIC(cur_charset); @@ -1974,7 +1976,7 @@ CharSet conv_get_locale_charset(void) return cur_charset; } -#ifdef G_OS_WIN32 +#if defined(G_OS_WIN32) || defined(__APPLE__) cur_charset = conv_get_charset_from_str(conv_get_locale_charset_str()); S_UNLOCK(cur_charset); @@ -2016,7 +2018,7 @@ const gchar *conv_get_locale_charset_str(void) S_LOCK(codeset); if (!codeset) { -#ifdef G_OS_WIN32 +#if defined(G_OS_WIN32) || defined(__APPLE__) g_get_charset(&codeset); if (!strcmp(codeset, CS_US_ASCII) || !strcmp(codeset, CS_ANSI_X3_4_1968)) -- cgit v1.2.3