Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2005, 07:23 AM
Junior Member
 
Join Date: Aug 2005
Posts: 1
Default Saving xml in UNICODE format (NOT in UTF-8)

Hi All,
I want to save a xml file in unicode Format.
I have gone through the thrread on same topic
http://www.topcmm.com/forum/thread_1_1032.html
But it saves the xml in UTF-8. Ieant to save the file in UNICODE or UTF-16
Thank in advance

Mahesh Kokadwar
Reply With Quote
  #2 (permalink)  
Old 08-05-2005, 02:53 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Saving xml in UNICODE format (NOT in UTF-8)

Code:
var f = new FileStream("c:\\my.xml", "w");
f.write('<?xml version="1.0" encoding="unicode"?>');
f.wrteUnicodeString(xml);
// the writeUnicodeString will write two '0's after the string, remove it
f.length = f.length - 2;
f.close();
Reply With Quote
  #3 (permalink)  
Old 08-11-2005, 01:12 PM
Junior Member
 
Join Date: Jun 2005
Posts: 4
Default Re:Saving xml in UNICODE format (NOT in UTF-8)

Hi

File Stream method would just add the encoding line to the XML but would still save the file in ANSI format.

Try this thing:

//---------Start

var sFinalText="<pages><page>test Page</page></pages>"
var objStream=new ActiveXObject("ADODB.Stream");
objStream.Open
objStream.Position = 0
objStream.Charset = "UTF-16"
objStream.WriteText= sFinalText
objStream.SaveToFile= "text.xml"

//--------End

This would do save the file in UNICODE format.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:53 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.