return $to_line;
}
- function translateText($body, $wrap_at) {
+ function translateText($body, $wrap_at, $charset) {
/** Add any parsing you want to in here */
$body = trim($body);
$body_ary = explode("\n", $body);
$line = $body_ary[$i];
$line = "^^$line";
- $line = str_replace(">", ">", $line);
- $line = str_replace("<", "<", $line);
+ //$line = str_replace(">", ">", $line);
+ //$line = str_replace("<", "<", $line);
+ //$line = htmlspecialchars($line);
if (strlen($line) >= $wrap_at) // -2 because of the ^^ at the beginning
$line = wordWrap($line, $wrap_at);
+ $line = charset_decode($charset, $line);
+
$line = str_replace(" ", " ", $line);
$line = str_replace("\t", " ", $line);
$line = nl2br($line);
function replace_escaped_spaces ($string) {
return str_replace(" ", " ", $string);
}
-
- function count_chars($string) {
- for ($i = 0; $i < strlen($string); $i++) {
- $ch = substr($string, $i, 1);
- $size++;
- if ($ch == "\\") {
- $i++;
- $ch = substr($string, $i, 1);
- if ($ch == "n")
- $i--;
- if ($ch == "r")
- $i--;
- }
- }
- return $size;
- }
?>