$OpenBSD: patch-sal_osl_unx_nlsupport_c,v 1.2 2006/08/20 03:36:52 kurt Exp $
--- sal/osl/unx/nlsupport.c.orig.port	Tue Jul 25 05:40:46 2006
+++ sal/osl/unx/nlsupport.c	Fri Aug 18 15:47:43 2006
@@ -38,7 +38,7 @@
 #include <osl/process.h>
 #include <rtl/memory.h>
 
-#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX)
+#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD)
 #include <pthread.h>
 #ifndef MACOSX
  #include <locale.h>
@@ -234,7 +234,7 @@ static rtl_Locale * _parse_locale( const
     return NULL;
 }
         
-#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD)
+#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
 
 /*
  * This implementation of osl_getTextEncodingFromLocale maps
@@ -551,6 +551,35 @@ const _pair _nl_language_list[] = {
     { "UTF-8",         RTL_TEXTENCODING_UTF8           }  /* ISO-10646/UTF-8 */
 };
 
+#elif defined(OPENBSD)
+    
+const _pair _nl_language_list[] = {
+    { "646",           RTL_TEXTENCODING_ASCII_US       },  /* fake: ASCII_US */
+    { "ASCII",         RTL_TEXTENCODING_ASCII_US       }, /* US-ASCII */
+    { "BIG5",          RTL_TEXTENCODING_BIG5           }, /* China - Traditional Chinese */   
+    { "CP1251",        RTL_TEXTENCODING_MS_1251        }, /* MS-CYRL */
+    { "CP866",         RTL_TEXTENCODING_IBM_866        }, /* CP866 866 */
+    { "CTEXT",         RTL_TEXTENCODING_ASCII_US       }, /* US-ASCII */
+    { "EUCCN",         RTL_TEXTENCODING_EUC_CN         }, /* China - Simplified Chinese */
+    { "EUCJP",         RTL_TEXTENCODING_EUC_JP         }, /* Japan */
+    { "EUCKR",         RTL_TEXTENCODING_EUC_KR         }, /* Korea */
+    { "EUCTW",         RTL_TEXTENCODING_EUC_TW         }, /* China - Traditional Chinese */
+    { "ISO-2022-JP",   RTL_TEXTENCODING_DONTKNOW       }, /* */
+    { "ISO-2022-JP-2", RTL_TEXTENCODING_DONTKNOW       }, /* */
+    { "ISO8859-1",     RTL_TEXTENCODING_ISO_8859_1     }, /* Western */
+    { "ISO8859-15",    RTL_TEXTENCODING_ISO_8859_15    }, /* Western Updated (w/Euro sign) */
+    { "ISO8859-2",     RTL_TEXTENCODING_ISO_8859_2     }, /* Central European */
+    { "ISO8859-4",     RTL_TEXTENCODING_ISO_8859_4     }, /* LATIN4 L4 */
+    { "ISO8859-5",     RTL_TEXTENCODING_ISO_8859_5     }, /* Cyrillic */
+    { "ISO8859-7",     RTL_TEXTENCODING_ISO_8859_7     }, /* Greek */
+    { "ISO8859-9",     RTL_TEXTENCODING_ISO_8859_9     }, /* Turkish */
+    { "KOI8-R",        RTL_TEXTENCODING_KOI8_R         }, /* KOI8-R */
+    { "KOI8-U",        RTL_TEXTENCODING_KOI8_U         }, /* KOI8-U */
+    { "SJIS",          RTL_TEXTENCODING_SHIFT_JIS      }, /* Japan */
+    { "US-ASCII",      RTL_TEXTENCODING_ASCII_US       }, /* US-ASCII */
+    { "UTF-8",         RTL_TEXTENCODING_UTF8           }  /* ISO-10646/UTF-8 */
+};
+
 #endif /* ifdef SOLARIS IRIX LINUX FREEBSD NETBSD */
 
 static pthread_mutex_t aLocalMutex = PTHREAD_MUTEX_INITIALIZER;
@@ -973,7 +1002,7 @@ int _imp_setProcessLocale( rtl_Locale * 
             snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX )
+#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( OPENBSD )
             setenv( "LC_ALL", locale_buf, 1);
 #else
             setenv( "LC_ALL", locale_buf );
@@ -985,7 +1014,7 @@ int _imp_setProcessLocale( rtl_Locale * 
             snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX )
+#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX  || defined( OPENBSD )
             setenv("LC_CTYPE", locale_buf, 1 );
 #else
             setenv( "LC_CTYPE", locale_buf );
@@ -997,7 +1026,7 @@ int _imp_setProcessLocale( rtl_Locale * 
             snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX )
+#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( OPENBSD )
             setenv("LC_CTYPE", locale_buf, 1 );
 #else
             setenv( "LANG", locale_buf );
