473,395 Members | 1,720 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,395 software developers and data experts.

Printing a UTF-8 encoded XML file

Hi,

I am computing an XML file with all necessary tags, to be used in
dedicated XML software. I am computing it as a text file but don't know
how to do to save it to the disk UTF-encoded. strConv() with constant =
64 does not work, because the default code page of the system is UTF-16
and the XML editor I am using, XMLSpy, expects structured text when
importing text files (so it cannot import my tagged files).

The only way I have found out to convert to UTF-8: copy / paste the
text from a text editor into XMLSpy, and save. But the procedure would
be more elegant without that step. What I am looking for is:
automation.

Can anybody help with this, please?

Reto Hadorn
SIDOS

Nov 13 '05 #1
1 2803
On 10 Nov 2005 00:58:14 -0800, "re*********@sidos.unine.ch"
<re*********@sidos.unine.ch> wrote:
Hi,

I am computing an XML file with all necessary tags, to be used in
dedicated XML software. I am computing it as a text file but don't know
how to do to save it to the disk UTF-encoded. strConv() with constant =
64 does not work, because the default code page of the system is UTF-16
and the XML editor I am using, XMLSpy, expects structured text when
importing text files (so it cannot import my tagged files).

The only way I have found out to convert to UTF-8: copy / paste the
text from a text editor into XMLSpy, and save. But the procedure would
be more elegant without that step. What I am looking for is:
automation.

Can anybody help with this, please?

Reto Hadorn
SIDOS


Use the MSXML library to build your XML instead of building XML text directly
- this will save you a lot of pain the first time you need a quote mark or a
semicolon in your data, etc., and you can use the SAX writer to output using
whatever text encoding you need. The examples on-line at MSDN and Microsoft
Support will get you through the less obvious steps to do that.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Steven T. Hatton | last post by:
I'm trying to write a program like hexel. I guess I could fish out the source for hexel and look at that, but for now I'm trying to figure out how I can do with with std::stringstream and...
5
by: John Bowman | last post by:
Hi, I've been reading through the threads on using the WebBrowser control in C# app's and how to print it's contents. I've got that much working. However, the big problem is I can't figure out...
4
by: Spencer H. Prue | last post by:
Hello, I am trying to print a unicode character that's in Japanese. In my ASP.NET app (C#) I just set a char to that unicode character and use a response.write(). The char prints, but it is just a...
2
by: yulyos | last post by:
Hi Answer To Printing from Right To Left To The Printer in VB.NE Printing From Right To Left To The Printer in VB.NE you can download a small example http://www.geocities.com/vmtnl/rtl.htm...
6
by: Rand | last post by:
Hello anyone, Situation: I want to print 1 or x mailing continuous form labels 1" X 3.5" then change to a different name and print again. Everything works fine except for problem below. ...
4
by: James Proctor | last post by:
Hi there Ive got a class which i use for alot of data storage in my program and id like to add a print routine to this class so that i can print out a formatted version of all the data. I just...
29
by: Ron Garret | last post by:
>>> u'\xbd' u'\xbd' >>> print _ Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in position 0: ordinal not in...
2
by: =?Utf-8?B?TUFUVA==?= | last post by:
What i am trying to accomplish is programatically creating Invoices and then Printing them out. I don't really need to "View" them before they print. How I am trying to do this is I have created...
5
by: Xah Lee | last post by:
If i have a nested list, where the atoms are unicode strings, e.g. # -*- coding: utf-8 -*- ttt=, ,...] print ttt how can i print it without getting the u'\u1234' notation? i.e. i want it...
2
by: David | last post by:
Hi list. I've never used unicode in a Python script before, but I need to now. I'm not sure where to start. I'm hoping that a kind soul can help me out here. My current (almost non-existant)...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.