Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

utf8 decoding

Status
Not open for further replies.

homefish

MIS
May 23, 2003
11
0
0
GB
An external app is generating files with names like =UTF-8BTW9uaXRvciBDb21wYW55IEdCLUFLUk9TLTVVR0hMUC0wLUkyLnhscw===.

I need to rename them to something more useful in a W32 environment (they are mostly PDFs but some are, eg, Excel spreadsheets). I suspect that the current name is, in some sense, a UTF-8 encoded version of the "real" filename (and, hopefully, extension) but the utf8 man page says "files and strings which contain only 7-bit ASCII characters have the same encoding under both ASCII and UTF-8" and "no ASCII byte can appear as part of another character" so it doesn't appear to be raw UTF8.

I've tried feeding the string to several decoders such as
Encode.pm and Encode::MIME::Header.pm without success.

Does anyone recognise the encoding of the sample string above and can anyone help me translate it?

Thanks,

fish.
 
By the time the filename is generated its to late (for the name at least). The generating application is now non-compliant in its naming of files which appears to happen before you ever get there.

Internally to perl though you can do a 'use utf8;' and get access to read and write utf8 strings natively.

This is probably not going to help you.
 
Hmm. That's what I suspected. I guess I'll just have to run the
Code:
file
command on it and give it a suitable extension.

Thanks anyway ;-)


fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top