public function big52utf8($str) { //$str = mb_convert_encoding($str, "UTF-8", "BIG5"); $str = parent::big52utf8($str); //$str = $this->strRevise($str); return $str; }
public function big52utf8($str) { $str = parent::big52utf8($str); $i = 1; while ($i != 0) { //print $string; $pattern = '/&#\\d+\\;/'; preg_match($pattern, $str, $matches); $i = sizeof($matches); if ($i != 0) { $unicode_char = mb_convert_encoding($matches[0], 'UTF-8', 'HTML-ENTITIES'); $str = preg_replace("/{$matches['0']}/", $unicode_char, $string); } //end if } return $str; }