0

I need to take a unicode string to HTML Entities.

Let's say the string is: ιи¢яє∂ιвℓє ѕкιℓℓѕ

I want it to convert it to ιи¢яє∂ιвℓє ѕкιℓℓѕ

In order to be able to store it in my SQL db and then output the desired text later.

This basically has the functionality I want, where you type in a string and itn converts it: http://www.online-toolz.com/tools/unicode-html-entities-convertor.php

I'm not very familiar with UTF-8/ASNII/different types of special characters in general, But I'd like it to be able to handle all the Unicode characters here: https://unicode-table.com/en/

Sorry if this is a dumb question but I tried all combinations of uft8_decode, htmlentities, htmlspecialchars and mb_convert_encoding and I can't get the desired result.

Thank you for looking!

Vlad
  • 9
  • 2
  • Why not use a UTF8 table? – chris85 Mar 19 '17 at 17:31
  • You mean just set the collation to utf8_bin in phpmyadmin? That worked actually, I thought if I put it to utf8 it would only accept those special characters and reject normal letters but it works for normal English characters too. (As I said I've never dealt with special characters before) If that's all I have do then thank you so much, that's amazing and a huge help. – Vlad Mar 19 '17 at 17:43
  • Yes, standard characters are also in the utf8 character set. – chris85 Mar 19 '17 at 17:46
  • Possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – chris85 Mar 19 '17 at 17:48
  • 1
    Thank you again I appreciate all the help and quick replies! – Vlad Mar 19 '17 at 18:16
  • HTML encoding is not for database storage. – axiac Mar 19 '17 at 19:49
  • You should read up on the different encodings and collations before choosing utf8_bin, you'd get much better unicode support with a utf8mb4_unicode collation... – Beat Mar 21 '17 at 06:16

0 Answers0