Workaround for EIMS split response to SEARCH
[squirrelmail.git] / functions / i18n.php
index 03c485547bd16725786b427ab51df4303afc2f7e..7c99aface939fbf4272fd2f53bfacbb6d9b81348 100644 (file)
  * encoded using Unicode entities according to HTML 4.0.
  *
  * $Id$
+ * @package squirrelmail
  */
 
+/** Everything uses global.php... */
 require_once(SM_PATH . 'functions/global.php');
 
-/* Decodes a string to the internal encoding from the given charset */
+/**
+ * Decodes a string to the internal encoding from the given charset
+ * 
+ * @param string $charset
+ * @param string $string Text to be decoded
+ * @return string Decoded text
+ */
 function charset_decode ($charset, $string) {
     global $languages, $squirrelmail_language, $default_charset;
     global $use_php_recode, $use_php_iconv, $agresive_decoding;
@@ -771,10 +779,16 @@ function korean_charset_xtra() {
     return $ret;
 }
 
-/* 
+/**
+ * Replaces non-braking spaces inserted by some browsers with regular space
+ * 
  * This function can be used to replace non-braking space symbols 
  * that are inserted in forms by some browsers instead of normal 
  * space symbol.
+ *
+ * @param string $string Text that needs to be cleaned
+ * @param string $charset Charset used in text
+ * @return string Cleaned text
  */
 function cleanup_nbsp($string,$charset) {
 
@@ -814,6 +828,15 @@ endswitch;
  return str_replace($nbsp,' ',$string);
 }
 
+/**
+ * Function informs if it is safe to convert given charset to the one that is used by user.
+ *
+ * It is safe to use conversion only if user uses utf-8 encoding and when 
+ * converted charset is similar to the one that is used by user.
+ *
+ * @param string $input_charset Charset of text that needs to be converted
+ * @return bool is it possible to convert to user's charset
+ */
 function is_conversion_safe($input_charset) {
   global $languages, $sm_notAlias, $default_charset;