php convert special characters to unicode

Solutions on MaxInterview for php convert special characters to unicode by the best coders in the world

showing results for - "php convert special characters to unicode"
Gabriella
12 Sep 2020
1<?php
2/* Convert internal character encoding to SJIS */
3$str = mb_convert_encoding($str"SJIS");
4
5/* Convert EUC-JP to UTF-7 */
6$str = mb_convert_encoding($str"UTF-7""EUC-JP");
7
8/* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */
9$str = mb_convert_encoding($str"UCS-2LE""JIS, eucjp-win, sjis-win");
10
11/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
12$str = mb_convert_encoding($str"EUC-JP""auto");
13?>
Ren
16 Sep 2016
1$str = "d&#039;&eacute;tudes"; //string with special characters
2$normal_str = html_entity_decode($str, ENT_QUOTES);  //d'études(studies in english)
3