What is the best way to handle/remove, UTF-8's Right-to-left-override characters?

后端 未结 1 1565
抹茶落季
抹茶落季 2021-01-21 05:54

There is a utf-8 character (HEX bytes E2 80 AE) that when correctly handled by utf-8 enabled systems will show the ascetically reversed chars, when displayed to the user. Common

相关标签:
1条回答
  • 2021-01-21 06:33

    Upon some further tests I added US-ASCII//TRANSLIT - UTF-8//IGNORE so to fix these types of strings without using regex you would use:

    echo iconv('US-ASCII//TRANSLIT', 'UTF-8//IGNORE', $evilString); //EvilFile.EXE
    

    Hope this helps anyone in the future with this unique problem.

    0 讨论(0)
提交回复
热议问题