Storing a UTF8 string fails with Cyrillic characters.

Brian Nickel brian.nickel at gmail.com
Thu Jun 2 00:29:15 CEST 2005


Okay, I figured out what was going wrong. I thought setTitle and the like 
would set an Id3v2 frame's encoding using the TagLib::String's encoding, and 
wasn't setting it, so it was still being stored and read as Latin1.

Thanks for your help. Again, this is an outstanding library.

-Brian

On 5/31/05, Scott Wheeler <wheeler at kde.org> wrote:
> 
> On Tuesday 31 May 2005 23:11, Brian Nickel wrote:
> > Hi,
> >
> > I'm writting a tagging plugin for the Muine Music Player (Gnome/C#)
> > using TagLib. Everything is going well, and the library is beautiful
> > to use, but I'm trying to get UTF8 strings to save as UTF8.
> >
> > One simple example:
> >
> > char * val = "Да, вы можете.";
> > myTag->setTitle (TagLib::String(val, TagLib::String::UTF8));
> > // myTag->title ().toCString (true) == "0, 2K <>65B5."
> >
> > Am I just doing something wrong, or is there another way to go about
> > this, or is it a bug?
> 
> It's probably just an issue somewhere between unicode literals (i.e. did 
> you
> save the file as UTF-8 encoded?) the console's locale and whatnot. It 
> should
> work fine in real code -- that's the same method we use to convert things 
> to
> and from QString and it works quite well:
> 
> #define QStringToTString(s) TagLib::String(s.utf8().data(),
> TagLib::String::UTF8)
> 
> (s.utf8().data() just returns a "const char *" of utf8 data)
> 
> Cheers,
> 
> -Scott
> 
> --
> The three chief virtues of a programmer are: laziness, impatience and 
> hubris.
> --Larry Wall
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20050602/47c90320/attachment.html


More information about the taglib-devel mailing list