X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FHelper%2FCharset.php;h=5fa54225a36ee8b3f005db1994e9ddf432dadf64;hb=b337d292eb5b5656d27a2fc9ab6796be300c59a3;hp=78bc8135bfdadee737d53ac08957e13a762d5937;hpb=affe41f5f2420693ea08b1b9496b6fc5dd786e20;p=plcapi.git diff --git a/src/Helper/Charset.php b/src/Helper/Charset.php index 78bc813..5fa5422 100644 --- a/src/Helper/Charset.php +++ b/src/Helper/Charset.php @@ -51,6 +51,8 @@ class Charset * @param string $tableName * @throws \Exception for unsupported $tableName * @todo add support for cp1252 as well as latin-2 .. latin-10 + * Optimization creep: instead of building all those tables on load, keep them ready-made php files + * which are not even included until needed * @todo should we add to the latin-1 table the characters from cp_1252 range, i.e. 128 to 159 ? * Those will NOT be present in true ISO-8859-1, but will save the unwary windows user from sending junk * (though no luck when receiving them...) @@ -125,6 +127,7 @@ class Charset * but then take those into account as well in other methods, ie.isValidCharset) * @todo when converting to ASCII, allow to choose whether to escape the range 0-31,127 (non-print chars) or not * @todo allow picking different strategies to deal w. invalid chars? eg. source in latin-1 and chars 128-159 + * @todo add support for escaping using CDATA sections? (add cdata start and end tokens, replace only ']]>' with ']]]]>') * * @param string $data * @param string $srcEncoding @@ -176,6 +179,7 @@ class Charset } else if ($ii < 128) { /// @todo shall we replace this with a (supposedly) faster str_replace? + /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? switch ($ii) { case 34: $escapedData .= '"';