tgalopin / html-sanitizer

Sanitize untrustworthy HTML user input
MIT License
390 stars 41 forks source link

  is getting converted to 00a0 #48

Closed rohitcoder closed 4 years ago

rohitcoder commented 4 years ago

Hi @tgalopin I am using this sanitizer for sanitizing HTML Text, i noticed its converting   to 00a0 any idea how to fix this issue?

tgalopin commented 4 years ago

Hum, that's super weird! Any idea where it may come from? Would you have a reproducer?

rohitcoder commented 4 years ago

Hi i tried to reproduce this issue in separate file and it was working fine, after investigation i found that i was converting sanitized test to json_encode() and during that conversion   was getting converted into u00a0.

This issue is not related with html-sanitizer I solved this issue by adding second args JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES in json_encode()

Now, everything is working fine, thanks :) !