瀏覽代碼

Added bind_textdomain_charset function. Allows to use non default
charset for gettext enabled php. For example ru_RU locale in ISO8859-5
and SquirrelMail ru_RU translation done in koi8-r or cp1251.
Works only with php 4.2+, but squirrelmail can function without it.

Thanks to Viktor S. Grishchenko and Grisha Mokhin

tokul 22 年之前
父節點
當前提交
c53cfa5e46
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      functions/i18n.php

+ 3 - 0
functions/i18n.php

@@ -1142,6 +1142,9 @@ function set_up_language($sm_language, $do_search = false) {
          isset($languages[$sm_notAlias]['CHARSET']) ) {
         bindtextdomain( 'squirrelmail', SM_PATH . 'locale/' );
         textdomain( 'squirrelmail' );
+	if (function_exists('bind_textdomain_codeset')) {
+	     bind_textdomain_codeset ("squirrelmail", $languages[$sm_notAlias]['CHARSET'] );
+	}
         if ( !ini_get('safe_mode') &&
              getenv( 'LC_ALL' ) != $sm_notAlias ) {
             putenv( "LC_ALL=$sm_notAlias" );