Browse Source

[svn r21618] FS#306 - The multi-byte string library: Renaming a local variable $charset into $system_encoding for avoiding confusion while reading code.

Ivan Tcholakov 15 years ago
parent
commit
217aae3678
1 changed files with 5 additions and 5 deletions
  1. 5 5
      main/inc/lib/multibyte_string_functions.lib.php

+ 5 - 5
main/inc/lib/multibyte_string_functions.lib.php

@@ -166,19 +166,19 @@ function api_utf8_decode($string, $to_encoding = null) {
  * @return string								Returns the converted string.
  */
 function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false) {
-	$charset = api_get_system_encoding();
+	$system_encoding = api_get_system_encoding();
 	if (empty($from_encoding)) {
-		if (api_is_utf8($charset)) {
+		if (api_is_utf8($system_encoding)) {
 			$from_encoding = api_get_non_utf8_encoding();
 		} else {
 			$from_encoding = 'UTF-8';
 		}
 	}
-	if (api_equal_encodings($charset, $from_encoding)) {
+	if (api_equal_encodings($system_encoding, $from_encoding)) {
 		return $string;
 	}
 	if ($check_utf8_validity) {
-		if (api_is_utf8($charset)) {
+		if (api_is_utf8($system_encoding)) {
 			if (api_is_valid_utf8($string)) {
 				return $string;
 			}
@@ -189,7 +189,7 @@ function api_to_system_encoding($string, $from_encoding = null, $check_utf8_vali
 			}
 		}
 	}
-	return api_convert_encoding($string, $charset, $from_encoding);
+	return api_convert_encoding($string, $system_encoding, $from_encoding);
 }
 
 /**