简体   繁体   English

id3lib在UTF-16中返回垃圾

[英]id3lib returning garbage in UTF-16

I'm trying to use id3lib to read tags from an Mp3 file, however the tags seem to be in UTF-16 encoding, so when I call ID3_Field::GetRawUnicodeText(); 我正在尝试使用id3lib从Mp3文件中读取标签,但是标签似乎采用UTF-16编码,因此当我调用ID3_Field::GetRawUnicodeText(); it returns the valid text, but with a bunch of garbage on the end. 它返回有效的文本,但最后带有一堆垃圾。 I have no way of getting the length of the string because ID3_Field::Size() returns the length with the included garbage. 我无法获取字符串的长度,因为ID3_Field::Size()返回包含所包含垃圾的长度。

Has anyone has any luck with this library? 有人对这个图书馆有好运吗? It seems to be the most popular library for reading Mp3 tags, but I've only had problems with it so far. 它似乎是读取Mp3标签的最受欢迎的库,但是到目前为止,我只遇到了问题。

Any tips on this would be much appreciated! 任何提示,将不胜感激!

Edit: If anyone can recommend a better library, that would be fantastic. 编辑:如果任何人都可以推荐一个更好的库,那就太好了。

It seems to be working now for no apparent reason. 似乎没有明显的原因在起作用。 I didn't change any code. 我没有更改任何代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM