summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class19
1 files changed, 2 insertions, 17 deletions
diff --git a/it_html.class b/it_html.class
index ed47abd..ece7070 100644
--- a/it_html.class
+++ b/it_html.class
@@ -258,21 +258,6 @@ function _parse_args($args)
}
-# internal
-function fix_encoding($string, $silent = false)
-{
- if (grapheme_strlen($string) === null)
- list($string, $error) = array(utf8_encode($string), utf8_encode("incorrectly utf8-encoded: " . trim($string)));
- else if (preg_match('/\xc3\x83\xc2[\x84\x9c\xa4\xb6\xbc\xa9\xa0]/', $string)) # Double encoded ÄÖÜäöüéà, UTF8SAFE
- list($string, $error) = array(utf8_decode($string), utf8_encode("doubly utf8-encoded: " . trim($string)));
-
- if ($error && !$silent)
- it::error(array('title' => $error, 'skipfiles' => "it_html"));
-
- return $string;
-}
-
-
/**
* function div($args...)
* Return a <div>...</div> element
@@ -328,7 +313,7 @@ function _tag($name, $args)
$result .= " />$newline";
if ($GLOBALS['debug_utf8check'] && $GLOBALS['it_html']->p['charset'] == "utf-8")
- $result = self::fix_encoding($result);
+ $result = it::any2utf8($result, "error in $name()");
return $result;
}
@@ -498,7 +483,7 @@ function Q($string)
if (preg_match('/[<>&"\x00-\x08\x0a-\x0c\x0e-\x1f\x80-\xff]/', $string)) # WARNING: copy/pasted to _tag()
{
if ($GLOBALS['debug_utf8check'] && $GLOBALS['it_html']->p['charset'] == "utf-8")
- $string = self::fix_encoding($string);
+ $string = it::any2utf8($string, "error in Q()");
$origstring = $string;
$string = @htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($string) : $string, ENT_COMPAT, $GLOBALS['it_html']->p['charset']);