htmlspecialchars() appears to be translating special chars like the following: āķūņūķī into their respective entity number:
ā ķ ū ņ ū ķ ī
While some remain untranslated such as:
žš
I would like htmlspecialchars()
(or some other function) to not translate these alphabetical type of characters... So that it only translates the following (as it seems to indicate on the php.net manual):
- '&' (ampersand) becomes '&'
- '"' (double quote) becomes '"' when ENT_NOQUOTES is not set.
- "'" (single quote) becomes ''' only when ENT_QUOTES is set.
- '<' (less than) becomes '<'
- '>' (greater than) becomes '>'
The reason why I need this is because after a POST request, i am running this user input through htmlspecialchars()
before placing it back into a new set of html inputs. Characters such as &,",',<,>, need to be translated so to not cause display errors etc. But i need the special chars such as 'āķūņūķī' remain unchanged. Else the user will be very confused.
htmlspecialchar()
s 3rd parameter supports encoding, maybe this helps. – ccKep