Thread

Posted on Mon Sep 18 05:54:09 2006 by springlee
How to parse Chinese Simple by XML-Simple?
I'am a beginner for perl. I want to write and read some Chinese charactor in a XML configure file, but I failed. Who can tell me how to do? Thanks!
Direct Responses: 3070 | Write a response
Posted on Mon Sep 18 06:08:55 2006 by grantm in response to 3068
Re: How to parse Chinese Simple by XML-Simple?

1. I recommend asking your question on PerlMonks.

2. You don't mention what went wrong. When you post on PerlMonks, include some code; the error message if there was one; and describe the result you expected.

3. Any data returned by XML::Simple will be encoded in UTF-8 regardless of what encoding the XML document was in. This is a feature.

4. If your XML does not use ASCII or UTF-8 encoding then you *MUST* declare an encoding in the xml declaration.

Direct Responses: 3072 | Write a response
Posted on Mon Sep 18 06:33:52 2006 by springlee in response to 3070
Re: How to parse Chinese Simple by XML-Simple?
Thank you for your answer. My English is very poor, so I'm afraid I can't describe my question clear.
In the header, I write these:
use XML::Simple;
use XML::Parser;
use Data::Dumper;
use Encode;
use utf8;

Then, I wrote some Chinese Charactors in file by program and try to read it. The new charactor I input can be read correct, but charactors in program can't be shown correctly!

Perhaps encoding of program is not utf8, is it?

In addition, I prees refresh of IE, then I got three same article here. How to delete two of them?
Thanks!
Direct Responses: 3074 | Write a response
Posted on Mon Sep 18 13:08:45 2006 by grantm in response to 3072
Re: How to parse Chinese Simple by XML-Simple?

I've posted a response on PerlMonks.

Direct Responses: 3085 | Write a response
Posted on Tue Sep 19 05:41:55 2006 by springlee in response to 3074
Re: How to parse Chinese Simple by XML-Simple?
Thank you for your answer and I will try it!
Write a response