Assuming my project is utf-8 everywhere and always used with utf-8 encoded, is there anything legal that could break if I change all occurrences of htmlspecialchars($var) to htmlspecialchars($var, ENT_QUOTES, 'utf-8')
I know one thing: obviously, ENT_QUOTES differs from ENT_COMPAT in that it also avoids single quotes. Assuming I know that this alone won't break anything, is there anything else?
In other words:
Is there a possible result of htmlspecialchars () when used without the charset parameter, data only from the encoding, which will differ from htmlspecialchars () when used with the charset parameter?
( htmlspecialchars($stringThatIsValidUTF8, ENT_QUOTES) !== htmlspecialchars($stringThatIsValidUTF8, ENT_QUOTES, 'utf-8') , htmlspecialchars($stringThatIsValidUTF8, ENT_QUOTES) !== htmlspecialchars($stringThatIsValidUTF8, ENT_QUOTES, 'utf-8') ?)
My understanding says no, never. Stack Overflow So far, looking at my project sandbox with the changes also says no. However, I am not sure if I am missing something.
source share