PHP函数将Unicode转换成特殊字符?

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了PHP函数将Unicode转换成特殊字符?脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有 PHP函数来处理下面的编码?
.replaceAll("\u00c3\u0080","À")
  .replaceAll("\u00c3\u0081","Á")
  .replaceAll("\u00c3\u0082","Â")
  .replaceAll("\u00c3\u0083","Ã")
  .replaceAll("\u00c3\u0084","&AuML;")
  .replaceAll("\u00c3\u0085","Å")
  .replaceAll("\u00c3\u0086","Æ")
  .replaceAll("\u00c3\u00a0","à")
  .replaceAll("\u00c3\u00a1","á")
  .replaceAll("\u00c3\u00a2","â")
  .replaceAll("\u00c3\u00a3","ã")
  .replaceAll("\u00c3\u00a4","ä")
  .replaceAll("\u00c3\u00a5","å")
  .replaceAll("\u00c3\u00a6","æ")
  .replaceAll("\u00c3\u0087","Ç")
  .replaceAll("\u00c3\u00a7","ç")
  .replaceAll("\u00c3\u0090","Ð")
  .replaceAll("\u00c3\u00b0","ð")
  .replaceAll("\u00c3\u0088","È")
  .replaceAll("\u00c3\u0089","É")
  .replaceAll("\u00c3\u008a","Ê")
  .replaceAll("\u00c3\u008b","Ë")
  .replaceAll("\u00c3\u00a8","è")
  .replaceAll("\u00c3\u00a9","é")
  .replaceAll("\u00c3\u00aa","ê")
  .replaceAll("\u00c3\u00ab","ë")
  .replaceAll("\u00c3\u008c","Ì")
  .replaceAll("\u00c3\u008d","Í")
  .replaceAll("\u00c3\u008e","Î")
  .replaceAll("\u00c3\u008f","Ï")
  .replaceAll("\u00c3\u00ac","ì")
  .replaceAll("\u00c3\u00ad","í")
  .replaceAll("\u00c3\u00ae","î")
  .replaceAll("\u00c3\u00af","ï")
  .replaceAll("\u00c3\u0091","Ñ")
  .replaceAll("\u00c3\u00b1","ñ")
  .replaceAll("\u00c3\u0092","Ò")
  .replaceAll("\u00c3\u0093","Ó")
  .replaceAll("\u00c3\u0094","Ô")
  .replaceAll("\u00c3\u0095","Õ")
  .replaceAll("\u00c3\u0096","Ö")
  .replaceAll("\u00c3\u0098","Ø")
  .replaceAll("\u00c5\u0092","Œ")
  .replaceAll("\u00c3\u00b2","ò")
  .replaceAll("\u00c3\u00b3","ó")
  .replaceAll("\u00c3\u00b4","ô")
  .replaceAll("\u00c3\u00b5","õ")
  .replaceAll("\u00c3\u00b6","ö")
  .replaceAll("\u00c3\u00b8","ø")
  .replaceAll("\u00c5\u0093","œ")
  .replaceAll("\u00c3\u0099","Ù")
  .replaceAll("\u00c3\u009a","Ú")
  .replaceAll("\u00c3\u009b","Û")
  .replaceAll("\u00c3\u009c","Ü")
  .replaceAll("\u00c3\u00b9","ù")
  .replaceAll("\u00c3\u00ba","ú")
  .replaceAll("\u00c3\u00bb","û")
  .replaceAll("\u00c3\u00bc","ü")
  .replaceAll("\u00c3\u009d","Ý")
  .replaceAll("\u00c5\u00b8","Ÿ")
  .replaceAll("\u00c3\u00bd","ý")
  .replaceAll("\u00c3\u00bf","ÿ");
尝试使用“to”编码为“HTML-ENTITIES”的 mb_convert_encoding(),以及(如有必要)将“From”编码设置为“UTF-8”或使用的Unicode编码.

脚本宝典总结

以上是脚本宝典为你收集整理的PHP函数将Unicode转换成特殊字符?全部内容,希望文章能够帮你解决PHP函数将Unicode转换成特殊字符?所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。