Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Characters and encoding bullshit

Name: Anonymous 2012-11-07 21:55

So I've been trying to make a little C# application to parse a file name and its path to automatically tag my extensive library of music and have come upon TagLib to help me.

Now everything was going well until I fell upon some Japanese characters in my library. During parsing, it all appears to be fine, but when it executes the .Save() method, all characters become question marks (?). For example: "アールグレイ" will appear as such during debug, but on save, the actual tag will be "??????"

I have no idea if this is due to the library assuming the MP3 is in ID3v1 format, due to the .Save() method malfunctioning or something else. Has anyone used this library before and come upon a similar problem? Any idea how to fix this?

Name: Anonymous 2012-11-07 23:40

>>8
Actually FIOC is even worse. Last time I tried it, print "アールグレイ" failed with a hurr durr I can't figure out the TTY encoding error.

Name: Anonymous 2012-11-08 5:44

>>11
FIOC is a lot worse than you might think right off the bat. You can get it to recognize UTF-8 string input by using the PERFECT solution of inserting a comment
# -*- coding: utf-8 -*-
But you see, it doesn't actually use UTF-8 internally. It doesn't use UCS-4 either, as you might expect. No it uses UTF-16, and this affront to nature is something it will readily remind you of. See now you need to preface all your strings with a nice u"" so python knows it needs to use UTF-16 internally for THAT string (but only that string).

After you're done wasting memory and time debugging all the exceptions thrown because of encoding differences, you want to output. BUT WAIT you say, didn't you say my data was all UTF-16? That's right, so now you need to re-re-encode your data back to UTF-8, using the .encode("utf-8") function.

Conclusion: FIOC has implemented THE PERFECT SOLUTION to the problem of handling UNICODE.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List