By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,118 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,118 IT Pros & Developers. It's quick & easy.

Preserving Chinese Characters when reading and writing text

P: n/a
Hello peeps,

I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and
writing MP3 tags). I have been using PHP on the command line (Mac OS X
Unix shell, to be precise), and am getting on more or less OK.

So far, I have managed to parse my tab-delimited .txt file properly into
an array, and then use this array to update the tags on a bunch of MP3
audio files. Nice.

Thing is, some of the track names specified in my text file are in
Simplified Chinese characters. These show up just fine within my .txt
file's editor (TextMate), but appear garbled within the final output.
Ack.

What I need is a way of reading and/or preserving the Chinese
characters, so that I can (hopefully) write them to my MP3 files.

I am sure some of you have already cracked this one a long time ago. I
hope you'll exercise some patience and give me a few pointers here!

I am not much more than a PHP newbie, so forgive me if I have overlooked
anything obvious :-)

--
Clive Green
May 31 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 31, 11:11 am, Clive Green <e...@clivegreen.comwrote:
Hello peeps,

I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and
writing MP3 tags). I have been using PHP on the command line (Mac OS X
Unix shell, to be precise), and am getting on more or less OK.

So far, I have managed to parse my tab-delimited .txt file properly into
an array, and then use this array to update the tags on a bunch of MP3
audio files. Nice.

Thing is, some of the track names specified in my text file are in
Simplified Chinese characters. These show up just fine within my .txt
file's editor (TextMate), but appear garbled within the final output.
Ack.

What I need is a way of reading and/or preserving the Chinese
characters, so that I can (hopefully) write them to my MP3 files.

I am sure some of you have already cracked this one a long time ago. I
hope you'll exercise some patience and give me a few pointers here!

I am not much more than a PHP newbie, so forgive me if I have overlooked
anything obvious :-)

--
Clive Green
Play with encoding choices. UTF-8 for both the text file and the PHP
functions you use if possible.

-Mike PII

May 31 '07 #2

P: n/a
In article <11**********************@g4g2000hsf.googlegroups. com>,
Mike P2 <su***********@gmail.comwrote:
On May 31, 11:11 am, Clive Green <e...@clivegreen.comwrote:
Hello peeps,

I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and
writing MP3 tags). I have been using PHP on the command line (Mac OS X
Unix shell, to be precise), and am getting on more or less OK.

So far, I have managed to parse my tab-delimited .txt file properly into
an array, and then use this array to update the tags on a bunch of MP3
audio files. Nice.

Thing is, some of the track names specified in my text file are in
Simplified Chinese characters. These show up just fine within my .txt
file's editor (TextMate), but appear garbled within the final output.
Ack.

What I need is a way of reading and/or preserving the Chinese
characters, so that I can (hopefully) write them to my MP3 files.

I am sure some of you have already cracked this one a long time ago. I
hope you'll exercise some patience and give me a few pointers here!

I am not much more than a PHP newbie, so forgive me if I have overlooked
anything obvious :-)

--
Clive Green

Play with encoding choices. UTF-8 for both the text file and the PHP
functions you use if possible.

-Mike PII
Hello Mike, thanks for taking the time to add your comment.

I have a text file that is already UTF8 encoded. I suppose that I really
need to discover exactly how one reads and/or writes text strings in
such a way that double-byte characters (like Simplified Chinese Hanzi,
for example) get correctly displayed within an MP3 tag.

At the moment I am using Mp3_Id, a PEAR extension, which is working just
fine, but isn't receiving string data in the right format to display
Chinese characters within tag values.

I suspect that the answer to this issue is very straightforward. But I
am buggered if I know what it is!

Thanks again for responding, all the same. I do appreciate it!

--
Clive
Jun 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.