Russian language tag wrong coding...
-
- User
- Posts: 1
- Joined: Mon Jul 24, 2006 6:19 pm
Russian language tag wrong coding...
Thank you for nice class
-
- getID3() v2 developer
- Posts: 445
- Joined: Sun May 04, 2003 2:22 pm
- Location: Holmegaard, Denmark
If your files are tagged properly, you only ned to set the proper output encoding like this:
If this does not help, then your MP3 files are very likely tagged incorrectly with ID3 tags.
ID3v1 tags must be encoded in ISO-8859-1 according to specification. However several taggers use the system charset instead in order to allow cyrillic and other characters - otherwise it would be impossible.
getID3() can handle this through the encoding_id3v1 option:
ID3v2 tags must be encoded in ISO-8859-1 or UTF-8 according to specification. However some braindead taggers use the system charset instead and thus breaks specification for no reason.
getID3() can handle this through the encoding_id3v2 option:
YOUR_SYSTE_CHARTSET is probably CP1251, ISO-8859-5 or KOI8-R for Russia.
Code: Select all
// Initialize getID3 engine
$getid3 = new getID3;
// Tell getID3() to use UTF-8 encoding - must send proper header as well.
$getid3->encoding = 'UTF-8';
// Tell browser telling it use UTF-8 encoding as well.
header('Content-Type: text/html; charset=UTF-8');
If this does not help, then your MP3 files are very likely tagged incorrectly with ID3 tags.
ID3v1 tags must be encoded in ISO-8859-1 according to specification. However several taggers use the system charset instead in order to allow cyrillic and other characters - otherwise it would be impossible.
getID3() can handle this through the encoding_id3v1 option:
Code: Select all
$getid3->encoding_id3v1 = 'YOUR_SYSTEM_CHARSET';
ID3v2 tags must be encoded in ISO-8859-1 or UTF-8 according to specification. However some braindead taggers use the system charset instead and thus breaks specification for no reason.
getID3() can handle this through the encoding_id3v2 option:
Code: Select all
$getid3->encoding_id3v2 = 'YOUR_SYSTEM_CHARSET';
YOUR_SYSTE_CHARTSET is probably CP1251, ISO-8859-5 or KOI8-R for Russia.
-
- User
- Posts: 3
- Joined: Sun Jan 28, 2007 9:09 am
- Location: Israel
Hi, I have this problem with hebrew characters in the tags.
I've tried using
but I get the error message:
I've tried using
Code: Select all
$getid3->encoding_id3v1 = 'CP1255';
B.T.W - The site is a drupal installation, with PHP 5. iconv is installed.PHP does not have iconv() support - cannot convert from CP-1255 to UTF-8
-
- getID3() v2 developer
- Posts: 445
- Joined: Sun May 04, 2003 2:22 pm
- Location: Holmegaard, Denmark
-
- User
- Posts: 3
- Joined: Sun Jan 28, 2007 9:09 am
- Location: Israel
Hi Allan,
This is what phpinfo() has to say regarding the iconv:
iconv support: enabled
iconv implementation: glibc
iconv library version: 2.3.6
Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
This is what phpinfo() has to say regarding the iconv:
iconv support: enabled
iconv implementation: glibc
iconv library version: 2.3.6
Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
-
- getID3() v2 developer
- Posts: 445
- Joined: Sun May 04, 2003 2:22 pm
- Location: Holmegaard, Denmark
-
- User
- Posts: 3
- Joined: Sun Jan 28, 2007 9:09 am
- Location: Israel
OK, the error is gone, but the tags are still not read the way they should.Allan Hansen wrote:Please try getID3() 1.7.8b1 if you are not using that version already. I think I fixed a similar problem, but forgot to put it in the changelog.
My settings:
Code: Select all
$getID3 = new getID3;
$getID3->encoding = 'UTF-8';
$getID3->encoding_id3v1 = 'ISO-8859-1';
$getID3->encoding_id3v2 = 'UTF-8';
At the end of the function I print the info array and get the following:
Code: Select all
array (
'GETID3_VERSION' => '1.7.8b1',
'filesize' => 442586,
'avdataoffset' => 4608,
'avdataend' => 442458,
'fileformat' => 'mp3',
'audio' =>
array (
'dataformat' => 'mp3',
'channels' => 2,
'sample_rate' => 44100,
'bitrate' => 128000,
'channelmode' => 'stereo',
'bitrate_mode' => 'cbr',
'lossless' => false,
'encoder_options' => 'CBR128',
'compression_ratio' => 0.0907029478458,
'streams' =>
array (
0 =>
array (
'dataformat' => 'mp3',
'channels' => 2,
'sample_rate' => 44100,
'bitrate' => 128000,
'channelmode' => 'stereo',
'bitrate_mode' => 'cbr',
'lossless' => false,
'encoder_options' => 'CBR128',
'compression_ratio' => 0.0907029478458,
),
),
),
'tags' =>
array (
'id3v1' =>
array (
'title' =>
array (
0 => '
-
- getID3() v2 developer
- Posts: 445
- Joined: Sun May 04, 2003 2:22 pm
- Location: Holmegaard, Denmark