How to check whether the character is utf-8

Hi All,

I want to check whether the input string is in UTF-8 encoding formate, I googled but didnt get any fruitful results, pls assit me , thanks in advance.

regards, Loganathan

Hi Loganatha,

Please check this link, let me know if this what you are looking for



Hi Pradeep,

Thanks for your response, I just need to check the string, string=“ABCDabcd123”

it shows IBM4378, but I want to know whether the string is under UTF-8 encoding format or not

regards, Loganathan

Hi Loganathan,

I guess this might help you with your issue.

Try using this helper:

It puts a method utf8? on the String. So you can grab the String from mysql and see if it is utf8:


If is not, then you can try change the encoding of your String using other methods like:





Maybe this String is saved on mysql in one of these encodings.