squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

us_ascii.php
Go to the documentation of this file.
1 <?php
2 
21 function charset_encode_us_ascii ($string) {
22  // don't run encoding function, if there is no encoded characters
23  if (! preg_match("'&#[0-9]+;'",$string) ) return $string;
24 
25  $string=preg_replace("/&#([0-9]+);/e","unicodetousascii('\\1')",$string);
26  // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetousascii(hexdec('\\1'))",$string);
27 
28  return $string;
29 }
30 
42 function unicodetousascii($var) {
43 
44  if ($var < 128) {
45  $ret = chr ($var);
46  } else {
47  $ret='?';
48  }
49  return $ret;
50 }
$ret
$ret
Definition: webmail.php:172
charset_encode_us_ascii
charset_encode_us_ascii($string)
Definition: us_ascii.php:21
unicodetousascii
unicodetousascii($var)
Definition: us_ascii.php:42