Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursortoxml cannot work on UTF-8?

Status
Not open for further replies.

26270499

IS-IT--Management
Jul 26, 2002
3
HK
Hi,

I tried to export a table by use cursortoxml. It works fine with english version but since there has chinese characters inside the table, I need to export it using utf-8.

Is there any simple function to export data to utf-8?
This is what I use:
CursorToXML("test","outportfile.xml",1,512,0,"")

Please help. Thanks

Gemini
 

According to the Help file, the nflag parameter should be set to 0 not 512

nFlags
Specifies the type of XML schema that is produced according to the following table: nFlag Bit Output Description
0 0000 UTF-8 Formatted XML (default)
1 0001 Unformatted (continuous string) XML
2 0010 Empty elements written with both open and closing elements (For example, <cc04><cc04/>)
4 0100 Preserve white space in fields
8 1000 Wrap Memo fields in CDATA sections
16 10000 Output encoding
32 100000 Output encoding
512 1000000000 cOutput is Filename. The default nFlag value, 0, creates a memory variable


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,
I believe these "flags" are additive. So the 512, is actually 0+512 which should give UTF-8 Formatted XML + cOutput is Filename.

Rick
 
Hi all,

I found a way out. In fact we need to convert the doublebytes to UTF8 again. Here is my code:

CURSORTOXML("test","outfile",1,+32)
STRTOFILE(STRCONV(outfile,9),"test.xml")
 
rick
You are so right with this. I had a nightmare trying to sus it as with XMLTOCURSOR() which also needs the flags though the help doesn't say so explicitly.


Bob Palmer
The most common solution is H2O!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top