Warning, /sdk/cutehmi/external/recipes/i686-w64-mingw32/gettext/0002-add-GETTEXTIOENCODING-support.patch is written in an unsupported language. File is not indexed.
0001 This patch adds support for GETTEXTIOENCODING environment variable that can be 0002 set to override console codepage autodetection. This is particularly useful 0003 when redirecting the output to a pipe (console CP detection fails) and using 0004 localized messages. Inspired by Python's PYTHONIOENCODING. 0005 0006 --- a/gettext-runtime/gnulib-lib/localcharset.c Sat Jun 11 14:59:31 2016 0007 +++ b/gettext-runtime/gnulib-lib/localcharset.c Fri Jul 08 11:17:08 2016 0008 @@ -393,10 +393,16 @@ 0009 locale_charset (void) 0010 { 0011 const char *codeset; 0012 const char *aliases; 0013 0014 + /* Force output encoding, particularly useful for redirected output on win32 0015 + where charset detection fails when no actual console is attached. */ 0016 + const char *forced_encoding = getenv("GETTEXTIOENCODING"); 0017 + if (forced_encoding) 0018 + return forced_encoding; 0019 + 0020 #if !(defined WINDOWS_NATIVE || defined OS2) 0021 0022 # if HAVE_LANGINFO_CODESET 0023 0024 /* Most systems support nl_langinfo (CODESET) nowadays. */ 0025 --- a/gettext-runtime/intl/localcharset.c Sat Jan 24 09:21:24 2015 0026 +++ b/gettext-runtime/intl/localcharset.c Fri Jul 08 11:18:20 2016 0027 @@ -393,10 +393,16 @@ 0028 locale_charset (void) 0029 { 0030 const char *codeset; 0031 const char *aliases; 0032 0033 + /* Force output encoding, particularly useful for redirected output on win32 0034 + where charset detection fails when no actual console is attached. */ 0035 + const char *forced_encoding = getenv("GETTEXTIOENCODING"); 0036 + if (forced_encoding) 0037 + return forced_encoding; 0038 + 0039 #if !(defined WINDOWS_NATIVE || defined OS2) 0040 0041 # if HAVE_LANGINFO_CODESET 0042 0043 /* Most systems support nl_langinfo (CODESET) nowadays. */ 0044 --- a/gettext-tools/gnulib-lib/localcharset.c Sat Jun 11 15:00:01 2016 0045 +++ b/gettext-tools/gnulib-lib/localcharset.c Fri Jul 08 11:19:17 2016 0046 @@ -393,10 +393,16 @@ 0047 locale_charset (void) 0048 { 0049 const char *codeset; 0050 const char *aliases; 0051 0052 + /* Force output encoding, particularly useful for redirected output on win32 0053 + where charset detection fails when no actual console is attached. */ 0054 + const char *forced_encoding = getenv("GETTEXTIOENCODING"); 0055 + if (forced_encoding) 0056 + return forced_encoding; 0057 + 0058 #if !(defined WINDOWS_NATIVE || defined OS2) 0059 0060 # if HAVE_LANGINFO_CODESET 0061 0062 /* Most systems support nl_langinfo (CODESET) nowadays. */ 0063 --- a/gettext-tools/libgettextpo/localcharset.c Sat Jun 11 15:00:34 2016 0064 +++ b/gettext-tools/libgettextpo/localcharset.c Fri Jul 08 11:20:10 2016 0065 @@ -393,10 +393,16 @@ 0066 locale_charset (void) 0067 { 0068 const char *codeset; 0069 const char *aliases; 0070 0071 + /* Force output encoding, particularly useful for redirected output on win32 0072 + where charset detection fails when no actual console is attached. */ 0073 + const char *forced_encoding = getenv("GETTEXTIOENCODING"); 0074 + if (forced_encoding) 0075 + return forced_encoding; 0076 + 0077 #if !(defined WINDOWS_NATIVE || defined OS2) 0078 0079 # if HAVE_LANGINFO_CODESET 0080 0081 /* Most systems support nl_langinfo (CODESET) nowadays. */