Hi,

I want to check if a certain string is UTF-8 or not.

I have tried using is_utf8 from the Encode module, and utf8::is_utf8() but the string is detected wrong.

For example, if I have a UTF-8 encoded file and an ANSI encoded file, if I open them both without "<:utf8", is_utf8 shows that they are not UTF-8 strings, and if I open the files using "<:utf8", then is_utf8 shows that they both are UTF-8 strings.

I want to detect which file is UTF-8 encoded and which is not.

Actually, I want to get a text from a database and check if it is UTF-8 encoded, and if it is not, to encode it as UTF-8, because I don't want to encode a text as UTF-8 twice.

Can you tell me how can this be done?

Thank you.

Octavian


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to