Re: XML Filters for illegal characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Perhaps I am misunderstanding your problem, so let me ask it another 
>way.  Is the problem that you are getting characters entered into the 
>database that are encoded in one way (e.g. UTF-8) when you expected the 
>characters to be encoded in another way (e.g. ISO-8859-1)?

No, the problem involves characters in the text that are Illegal XML characters much like "&" is an Illegal XML character.  Only, the one the character that my software is reporting as illegal is apparently not one that is caught by the normal filters (like htmlentities or even some functions specifically coded for XML that I found on the PHP.net website).  I think the problem with the filters that I have tried is that they only attempt to change entities that are can be encoded to something XML safe.  Ideally, what I want is something that just removes the offending character if it cannot make it safe for XML.  So, say & is made into & but an unexpected symbol is simply removed. For example (suppose "^" is a symbol that cannot be encode for this example):

input: "str&ing"
output: "str&ing"

input: "str^ing"
output: "string"


I hope this makes things clear.  I think that a function just like htmlentities but one that just removes characters that are illegal but can not be fixed would be the ideal solution.

If anyone needs further clarification, I would be happy to try to provide it.




--
Doug Jones
Co-Op Web Developer
douglas.1.jones@xxxxxxxx

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux