$NetBSD: patch-cx,v 1.1.1.1 2002/02/13 18:09:22 mrauch Exp $ --- ../tools/source/string/charset.cxx.orig Thu May 10 13:35:20 2001 +++ ../tools/source/string/charset.cxx @@ -64,7 +64,7 @@ #elif defined( OS2 ) #define INCL_DOSNLS #include -#elif defined(LINUX) || defined(SOLARIS) +#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD) #include #include #include @@ -126,7 +126,7 @@ // ----------------------------------------------------------------------- -#if defined(NETBSD) || defined(SCO) +#if defined(SCO) // check if there is a charset qualifier at the end of the given locale string // e.g. de.ISO8859-15 or de.ISO8859-15@euro which strongly indicates what @@ -323,7 +323,7 @@ return RTL_TEXTENCODING_DONTKNOW; } -#elif defined(LINUX) || defined(SOLARIS) +#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD) typedef struct { const char *key; @@ -363,7 +363,7 @@ /* XXX MS-874 is an extension to tis620, so this is not * really equivalent */ -#elif defined(LINUX) +#elif defined(LINUX) || defined(NETBSD) const _pair _nl_language_list[] = { { "ANSI_X3.110-1983", RTL_TEXTENCODING_DONTKNOW },/* ISO-IR-99 NAPLPS */ @@ -541,7 +541,7 @@ }; -#endif /* LINUX, SOLARIS */ +#endif /* LINUX, SOLARIS, NETBSD */ static int _pair_compare (const char *key, const _pair *pair) @@ -601,7 +601,11 @@ /* get the charset as indicated by the LC_CTYPE locale */ char *ctype_locale = setlocale( LC_CTYPE, "" ); +#if defined(NETBSD) && !defined(CODESET) + char *codeset = NULL; +#else char *codeset = nl_langinfo( CODESET ); +#endif if ( codeset != NULL ) { @@ -707,11 +711,11 @@ #ifdef UNX CharSet nTextEncoding; -#if defined(NETBSD) || defined(SCO) +#if defined(SCO) nTextEncoding = GetSystemCharSetFromEnvironment(); if (nTextEncoding == RTL_TEXTENCODING_DONTKNOW) nTextEncoding = GetSystemCharSetFromSystemLanguage(); -#elif defined(LINUX) || defined(SOLARIS) +#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD) nTextEncoding = GetSystemCharsetFromNLLanginfo(); #elif defined(MACOSX) nTextEncoding = RTL_TEXTENCODING_DONTKNOW;