develooper Front page | perl.i18n | Postings from January 2008

Problem processing UTF-8 strings from email

Thread Next
From:
Neil Gunton
Date:
January 12, 2008 16:17
Subject:
Problem processing UTF-8 strings from email
Message ID:
4789589D.3080309@nilspace.com
Hi all,

I am somewhat experienced with Perl in general, but absolutely no 
experience dealing with UTF-8. I have a community journals website which 
allows updates from users via email. I'm having trouble with emails that 
contain Chinese characters encoded (I think) as UTF-8. The strings look 
like this:

=?UTF-8?B?5qGQ5LmhLCBUb25neGlhbmc6IEJlaW5nIGEgJ2hhbg==?= =?UTF-8?B?dHUn?=

When I read this text from a file, using my perl script, and then save 
it into MySQL, it comes out on the website looking literally like the 
above. I can't seem to get perl to "do" anything with it in terms of 
conversions to a format that looks like chinese characters when 
displayed on the Web.

Does anybody have any clues as to how to convert strings like this into 
something more usable - e.g. HTML character entities?

I'm using stock perl 5.8.8 from Debian Etch.

Thanks!

/Neil

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About