Hi allen,<br><br>Internally taglib stores tag in UTF16 encoding. While old taglib version will decode <br>as Latin1 in whatever case by mistake.<br>A work around is to specify UTF8 as default internal encoding, by something like this:
<br>&lt;code&gt;<br>TagLib::ID3v2::FrameFactory *f = Audio::TagLib::ID3v2::FrameFactory::instance();<br>f-&gt;setDefaultTextEncoding(TagLib::String::UTF8);<br>TagLib::MPEG::File *i = new TagLib::MPEG::File(path);<br>i-&gt;setID3v2FrameFactory(f);
<br>&lt;/code&gt;<br><br>A similar bugzilla at <a href="http://rt.cpan.org/Public/Bug/Display.html?id=25401">http://rt.cpan.org/Public/Bug/Display.html?id=25401</a><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&nbsp;&nbsp; 1. having trouble to encode muti-byte char (chinese big5) to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp3&#39;s title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using taglib (allen lau)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1
<br>Date: Sat, 31 Mar 2007 09:59:49 -0700 (PDT)<br>From: allen lau &lt;<a href="mailto:sirpelidor@yahoo.com">sirpelidor@yahoo.com</a>&gt;<br>Subject: having trouble to encode muti-byte char (chinese big5) to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp3&#39;s title&nbsp;&nbsp;&nbsp;&nbsp; using taglib
<br>To: <a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>Message-ID: &lt;<a href="mailto:917875.36723.qm@web58707.mail.re1.yahoo.com">917875.36723.qm@web58707.mail.re1.yahoo.com</a>&gt;<br>Content-Type: text/plain; charset=iso-8859-1
<br><br>Hi,<br><br>I was reading the thread on February 2007 titled: &quot;bug<br>encoding multibyte?&nbsp;&nbsp; Ray&quot;.&nbsp;&nbsp;But I didn&#39;t find my<br>answer, hope I can get my anaswer here :)<br><br>I was trying to write a chinese (big5) song title into
<br>a mp3 file using TagLib.&nbsp;&nbsp;Upon completed operation,<br>the song title shows as ????.mp3 in both window and<br>ITunes.&nbsp;&nbsp;I think I must missing a small step... would<br>anyone please help me take a look at what I did wrong?
<br><br>Thank you<br><br>[code]<br>string path = &quot;C:/test.mp3&quot;;<br><br>try<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TagLib.File file =<br>TagLib.File.Create(path);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.Tag.Title = &quot;&amp;#40654;&amp;#26126;&quot;;
<br>//big5 chinese char<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.Save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (Exception e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.Write(e.ToString());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>[/code]
<br><br><br></blockquote></div><br><br clear="all"><br>-- <br>cheers,<br>-dongxu<br>__END__<br><a href="http://search.cpan.org/~dongxu">http://search.cpan.org/~dongxu</a>