473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Preserving Chinese Characters when reading and writing text

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
2 4534
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
4
by: Winnie | last post by:
Hi, I am currently writing a C# Windows Application. On my form, I have several labels with Traditional Chinese text, it is ok on my machine (Windows 2000), but after install on Windows 98 or NT,...
0
by: Alex Chan | last post by:
Hi group, I am writing a RFC Server with SAP.NET Connector to connect to SAP. There are chinese characters passing back and forth. I found that all chinese characters sending from SAP are...
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
3
by: msnews.microsoft.com | last post by:
Hey there, I'm having trouble reading Simple Chinese characters from an XML document in an ASP file, I want to update the database based on what is in the file. Everytime, I read in the...
0
by: st.frey | last post by:
I've got a problem with importing chinese characters into a mysql-table and have read several mailings but didn't find a solution. i have a utf-8 text file that contains chinese characters. the...
5
by: Figmo | last post by:
I'm having a problem working with foreign characters (well....foreign to me anyway) I have a textbox control on a form. The font is set to MS Arial Unicode. If I use the Chinese input method...
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.