I'm trying to create an ID3_Tag for a file whose path name is like:
"C:\Bart=F3k\01-The System-TEST.mp3"
In my application, I have the path name as a Windows-type wchar_t pointer. =
I can convert it to UTF-8 easily, or to any other character encoding with =
some work.
If I try
myTag.Link(fileLoc, ID3TT_ID3V2);
and fileLoc is UTF-8, then Link() fails. (As a UTF-8 string, the =F3 is ex=
panded to 0xC3 0xB3). And there doesn't appear to be a way to Link() with =
a whcar_t version of fileLoc.
It looks like Id3lib tries to open the file in utils.cpp in ID3_Err dami::o=
penReadableFile(String name, ifstream& file) and it uses file.open(name.c_s=
tr() where file is an std::ifstream
I'm digging through and experimenting with the source code to try to figure=
out a way to fix this ... by any chance does anybody know a relatively eas=
y solution to this? Should I be converting the file path name to ISO-8859-=
1 (if I am remembering the "typical" windows code page correctly)?
There doesn't seem to be an equivalent call to Link() for wchar_t, or UTF-8=
. I kind of hate converting the string -from- unicode to a code page ... I=
guess that would probably not lead to data loss, the c++ std functions are=
probably going to recognize 8859-1, because that is what windows is using =
at least in the file system.
When I get the file path name from windows though, I have their idea of "UN=
ICODE" enabled, so Windows is giving me the path in whcar_t.
Anyway ... I am going to keep experimenting with this and digging through t=
he code, but I am about to break for lunch so I am hoping somebody might be=
reading the list and have an easy solution to this, because it is probably=
going to be a couple of hours at least of trial and error the way I'm doin=
g it.
Thanks for any help.
--=20
Joe Cosby
http://joecosby.com/=20
"For the first time in history of a civilized nation we have full gun
control and registration, our streets will be safer, the police will do
a better job of protecting its citizens, and the world will follow our
lead into the future".=20
-- Adolph Hitler - 1935
:: Currently listening to Sonate in G-Dur, Opus 5 No. 2, Adagio sostenuto, =
1799, by Beethoven, from "Cello-Sonaten"
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=3DTXT_TAGHM_Wave2_sharelife_0120=
08=
|