in reply to Re: MP3::Tag encoding problem
in thread MP3::Tag encoding problem
Your knowledge of unicode is impressive, and I wish to subscribe to your newsletter :-)
I saw the upside-down question mark for the second command, confirming that my terminal (Konsole) wants utf8. It also seems that specifying the binmode and commenting-out my misguided attempts at trying to solve the problem now means I'm seeing umlauts above my o's.
Thank you very much!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: MP3::Tag encoding problem
by jwhit61 (Initiate) on Dec 28, 2008 at 21:50 UTC | |
| [reply] |
by jwhit61 (Initiate) on Jan 03, 2009 at 14:17 UTC | |
and the following to read: The data will print correctly to STDOUT, but other programs that are reading the data, show the extended characters incorrectly. If I use easytag to manipulate the same tags after the write process above, the data is incorrect in easytag. I fix it inside of easytag and other programs like Mythmusic show the tags correctly. Also, post easytag, I remove the decode UTF8 instructions in my script and just print the data to STDOUT, the tags print correctly. The problem has to be with MP3::Tags. Here is my code. You will see that I am also writing FLAC tags when the fils has a flac extension, The same data that gives me grief for MP3 works just fine when I write to a FLAC file. I've commented out my UTF8 attempts in the MP3 code as it did not yield any difference to other applications.
| [reply] [d/l] [select] |
by jwhit61 (Initiate) on Jan 23, 2009 at 18:06 UTC | |
| [reply] [d/l] |
|
Re^3: MP3::Tag encoding problem
by lbt (Initiate) on Jan 01, 2009 at 11:41 UTC | |
The module returns a character string (Dec '08); so that's OK. Make sure any applications writing the tags encode properly. For linux, Easytag seems to work very well. What you want as a human but no good for mkpath() et al ah, now this is mkpath()-able Now, File::Find (properly) returns a binary string so needs decoding. Assuming your filesystem uses utf8 encoding: At this point you can print and compare $char_file_find_dir and $tag_dir. You can also compare and do filename tests etc with $binary_tag_dir and $File::Find::dir. When printing (including debugging) I had: This tells perl that my terminal is utf8 aware and to print accented characters appropriately. You should also encode() the binary strings before printing them if you want to read them (or not if you want to 'od' them) HTH Corretcions welcome ;) | [reply] [d/l] [select] |