calling update destroys unicode texts because
SetEncoding( ID3TE_ISO8859_1) is called.
When writing the tags with update you get the following
call stack (edited):
#7 0x402b735d in dami::convert
#8 0x4029b6eb in
ID3_FieldImpl::SetEncoding(ID3_TextEnc)
(this=0x816efd8, enc=ID3TE_ISO8859_1) at field.cpp:1182
#9 0x402a3f22 in dami::id3::v2::getString(ID3_Frame
const*, ID3_FieldID) (frame=0x0, fldName=ID3FN_TEXT) at
helpers.cpp:55
#10 0x402a430c in dami::id3::v2::getArtist() at
helpers.cpp:133
#11 0x402b6019 in dami::id3::v1::render() at
tag_render.cpp:47
#12 0x402ac2fb in RenderV1ToFile() at tag_file.cpp:202
#13 0x402ad64e in ID3_TagImpl::Update(unsigned short)
(this=0x83019d0, ulTagFlag=65535) at tag_file.cpp:400
#14 0x402ab7c8 in ID3_Tag::Update() at tag.cpp:719
As you can see getString set's the encoding to ASCII.
This destroys a unicode text as can be seen in my debug
output:
Debug: convert from UTF-16 to ISO-8859-1
Debug convert_i: 4:˙ţ:&
convert_i src, ff ˙
convert_i src, fe ţ
convert_i src, 3a :
convert_i src, 26 &
Debug error? 84
SetEncoding: ~&
Debug: convert from ISO-8859-1 to UTF-16
Debug convert_i: 2:~&
convert_i src, 7e ~
convert_i src, 26 &
Debug convert_i 2: 0 0 1018:˙ţ~
Debug convert_i 3: 6
convert_i trg, ff ˙
convert_i trg, fe ţ
convert_i trg, 7e ~
convert_i trg, 0
convert_i trg, 26 &
convert_i trg, 0
SetEncoding: ˙ţ~
The error in the middle is from iconv that can't
convert the codepoint 0x3a26 to an ascii character.
Please please, let me fix this by introducing a new
function for ID3_Field char* GetText( encoding, size_t*
len=NULL)