Exemplo n.º 1
0
 /**
  * Return UTF-8 string for a codepoint if that is a valid
  * character reference, otherwise U+FFFD REPLACEMENT CHARACTER.
  * @param int $codepoint
  * @return string
  * @private
  */
 static function decodeChar($codepoint)
 {
     if (Sanitizer::validateCodepoint($codepoint)) {
         return UtfNormal\Utils::codepointToUtf8($codepoint);
     } else {
         return UtfNormal\Constants::UTF8_REPLACEMENT;
     }
 }
Exemplo n.º 2
0
 /**
  * Return UTF-8 string for a codepoint if that is a valid
  * character reference, otherwise U+FFFD REPLACEMENT CHARACTER.
  * @param $codepoint Integer
  * @return String
  * @private
  */
 static function decodeChar($codepoint)
 {
     if (Sanitizer::validateCodepoint($codepoint)) {
         return codepointToUtf8($codepoint);
     } else {
         return UTF8_REPLACEMENT;
     }
 }