[svn r20963] FS#4246 - Correcting iconv-detection to be less aggressive but error safe. Cleaning previously commented code.

skala
Ivan Tcholakov 16 years ago
parent 2127f8988f
commit 72f8c8ab54
  1. 4
      main/inc/global.inc.php
  2. 9
      main/inc/lib/multibyte_string_functions.lib.php

@ -179,9 +179,6 @@ if (empty($charset)) {
api_mb_internal_encoding($charset);
api_mb_regex_encoding($charset);
api_iconv_set_encoding('iconv_internal_encoding', $charset);
// For now the following two lines have been identified as useless.
//api_iconv_set_encoding('iconv_input_encoding', $charset);
//api_iconv_set_encoding('iconv_output_encoding', $charset);
/*
--------------------------------------------
@ -428,7 +425,6 @@ else
}
/*
-----------------------------------------------------------
LOAD LANGUAGE FILES SECTION

@ -1322,14 +1322,7 @@ function api_iconv_present() {
if (!is_null($iconv_present)) {
return $iconv_present;
}
// I don't want to spoil the code with ugly strings.
$test_string = '';
for ($i = 32; $i < 128; $i++) {
$test_string .= chr($i);
}
$iconv_present = (function_exists('iconv') &&
@iconv('UTF-16LE', 'ISO-8859-1',
@iconv('ISO-8859-1', 'UTF-16LE', $test_string)) == $test_string) ? true : false;
$iconv_present = function_exists('iconv') ? true : false;
return $iconv_present;
}

Loading…
Cancel
Save