PDA

View Full Version : A small subroutine to deal with mixed encodings



Renyao
2005-08-12, 09:29
The attached HtmlAdjust.zip contains a package which when used
should be put into slim/Utils directory.

Refer to "Accented character problems" in Beta forum for details.

Dan Sully
2005-08-12, 10:05
* Renyao shaped the electrons to say...

>The attached HtmlAdjust.zip contains a package which when used
>should be put into slim/Utils directory.
>
>Refer to "Accented character problems" in Beta forum for details.

Renyao - could you send me an audio file which exhibits this problem?

dan | at | slimdevices.com

Thanks.

-D
--
vacation (n) : an extended trip away from home in search of inconvenient ways to connect to the Internet.

Renyao
2005-08-12, 12:29
Hi dan,

I send you a wave file in the attached zip file.

The file name is "07 東紅梅花開.wav" (not including thq quotes)

which is encoded in cp936.

The first Chinese character 東 is "\x96\x7C" ,the second byte of which
is "|".

The fifth Chinese character 開 is "\xE9\x5F" ,the second byte of which
is "_" .


My music fold is E:\slimmusic\music

I organize my wav file in the form of

E:\slimmusic\music\<artist>\<album>\<song>.wav

where <artist>,<album> and <song> are maily strings of Chinese characters

I use "Guess Tags Formats" to extract ARTIST,ALBUM,TRACKNUM and TITLE of
wave files.The formats are

/ARTIST/ALBUM/TRACKNUM.TITLE
/ARTIST/ALBUM/TRACKNUM TITLE
/ARTIST/ALBUM/TRACKNUM-TITLE


E:\slimmusic\music\青燕子演唱组\《七色光》\07 東紅梅花開.wav is the actual
path of the wav file.

I also have some ape files,wma files and mp3's.

By the way,when I play ape files(convert to wav on the fly),I hear a
click at the beginning of every track.but when I play them by converting to flac on the fly),all is fine.

While waiting I just noticed the songinfo.html web page change (which is still wrong).

The title,artist,album are encoded in cp936
Date Modified is in UTF-8 of cp936(UTF-8 of latin-1 in the past)
Location is in UTF-8 of latin-1 (UTF-8 of cp936 in the past)

"Browse music Folder" seems good now (wrong in the past,even in the 2005-8-10
nightly),

Sorry ,saying "Invalid Post specified. If you followed a valid link, please notify the webmaster"

The file is too big to upload successfuly.

But I'v given you enough information for you to test.Just rename a wav
file of your own to 07 東紅梅花開.wav

Only you can't hear the beautiful female voices.

The Chinese characters you see are probably latin-1 in your
environment

I made a mistake saying "\74" is "|"

"|" is "\7C"

Sorry for that