473,940 Members | 5,945 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with acent-grave like characters.

Helo i'v an xml file like this:

<bestand>
<id>8</id>
<beschrijving type="string">< ![CDATA[film voorcafe]]></beschrijving>
<file type="file"
mime-type-image="/xcm/mime_types/movie.gif"><![CDATA[voorcafédrietev ol.avi]]></file>
</bestand>
But the xml processor says:
"XML parser error 4: not well-formed (invalid token)"

That is because of the é in voorcafédrietev ol.avi
How do i solve this problem,

The value voorcafédrietev ol.avi is read from a database, i want
to support characters like this, but how?

Is this the solution: <?xml version="1" encoding="ISO-8859-1"?>

????

I think so, but why?
Jul 20 '05 #1
3 2063
Hi,

Sounds like your XML document is not properly encoded. When an XML parser
opens a document it uses a couple of things to determine the encoding of
that document, i.e. looking at the first few bytes (2 or 4) to see if they
imply the encoding; looking to see if the document starts with a BOM (byte
order marker); then looking at the encoding specified in the XML
declaration.
(see: http://www.w3.org/TR/2004/REC-xml-20.../#sec-guessing)

Having determined what encoding the document is - the XML parser will expect
every character within the document to be correctly encoded according to
that encoding. If you haven't specified an encoding (in the XML
declaration) and the document has no BOM and the first two bytes of the
document are 0x3C 0x3F then it will likely assume that the document is UTF-8
encoded - so it will expect all characters to be correctly encoded in UTF-8.
etc.etc.
Is this the solution: <?xml version="1" encoding="ISO-8859-1"?>

????

I think so, but why?
No, the solution is to specify in the encoding of the XML declaration the
encoding the document is actually encoded in.

BTW, even characters within CDATA sections have to be correctly encoded.
Cheers
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator

"Tjerk Wolterink" <tj***@wolterin kwebdesign.com> wrote in message
news:41******** **************@ news.wanadoo.nl ... Helo i'v an xml file like this:

<bestand>
<id>8</id>
<beschrijving type="string">< ![CDATA[film voorcafe]]></beschrijving>
<file type="file"
mime-type-image="/xcm/mime_types/movie.gif"><![CDATA[voorcafédrietev ol.avi]]</file>
</bestand>
But the xml processor says:
"XML parser error 4: not well-formed (invalid token)"

That is because of the é in voorcafédrietev ol.avi
How do i solve this problem,

The value voorcafédrietev ol.avi is read from a database, i want
to support characters like this, but how?

Is this the solution: <?xml version="1" encoding="ISO-8859-1"?>

????

I think so, but why?

Jul 20 '05 #2
Marrow wrote:
Hi,

Sounds like your XML document is not properly encoded. When an XML parser
opens a document it uses a couple of things to determine the encoding of
that document, i.e. looking at the first few bytes (2 or 4) to see if they
imply the encoding; looking to see if the document starts with a BOM (byte
order marker); then looking at the encoding specified in the XML
declaration.
(see: http://www.w3.org/TR/2004/REC-xml-20.../#sec-guessing)

Having determined what encoding the document is - the XML parser will expect
every character within the document to be correctly encoded according to
that encoding. If you haven't specified an encoding (in the XML
declaration) and the document has no BOM and the first two bytes of the
document are 0x3C 0x3F then it will likely assume that the document is UTF-8
encoded - so it will expect all characters to be correctly encoded in UTF-8.
etc.etc.

Is this the solution: <?xml version="1" encoding="ISO-8859-1"?>

????

I think so, but why?

No, the solution is to specify in the encoding of the XML declaration the
encoding the document is actually encoded in.

BTW, even characters within CDATA sections have to be correctly encoded.
Cheers
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator

"Tjerk Wolterink" <tj***@wolterin kwebdesign.com> wrote in message
news:41******** **************@ news.wanadoo.nl ...
Helo i'v an xml file like this:

<bestand>
<id>8</id>
<beschrijvi ng type="string">< ![CDATA[film voorcafe]]></beschrijving>
<file type="file"


mime-type-image="/xcm/mime_types/movie.gif"><![CDATA[voorcafédrietev ol.avi]]
</file>
</bestand>
But the xml processor says:
"XML parser error 4: not well-formed (invalid token)"

That is because of the é in voorcafédrietev ol.avi
How do i solve this problem,

The value voorcafédrietev ol.avi is read from a database, i want
to support characters like this, but how?

Is this the solution: <?xml version="1" encoding="ISO-8859-1"?>

????

I think so, but why?


How do know in wich encoding a file is?

I've edited some files xml files, and i think i can set the encoding in
my editor,

but php also creates some xml files, with : echo "<xml> bla bla";
how do i know wich encoding php will echo to?
Jul 20 '05 #3
Hi,
How do know in wich encoding a file is?
You don't normally need to know - the XML parser will detect it and verify
it. If you want to know what encoding a compliant XML parser will assume
then follow the same steps as the spec - but then, of course, that doesn't
tell you if the rest of the document is encoded correctly.
I've edited some files xml files, and i think i can set the encoding in
my editor,
An editor that is 'encoding aware' will probably give you choices, on
saving, as to which encoding.

but php also creates some xml files, with : echo "<xml> bla bla";
how do i know wich encoding php will echo to?


No idea, probably a question best aimed at a php newsgroup. I'd imagine
it's probably some localised 8-bit charset, ASCII or ANSII.

Cheers
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
Jul 20 '05 #4

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

Similar topics

0
3094
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in the context of a main window. The problem does not occur on HPUX or Linux. The following simple example code illustrates the problem and the work around I've come up with; However, I'd like, very much, to get rid of the kludgy work around....
11
3785
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class (ClassB* b; b->func(); ) the base-class function is called instead of the new function in the derived class. All other similar functions (virtual in the base class and overwritten in the the derived class) work fine, it's just this one function. ...
0
2034
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent users So I designed the project as master Node that has all administration
9
2267
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application which makes calls to the service. We are using tcp channel which is using binaryformatter by default. The problem is that after a certain number of remoting calls the calls dont get through to the server. The client application makes the call and...
117
7380
by: Peter Olcott | last post by:
www.halting-problem.com
17
16728
by: Jon Slaughter | last post by:
I'm having a little trouble understanding what the slicing problem is. In B.S.'s C++ PL3rdEd he says "Becayse the Employee copy functions do not know anything about Managers, only the Employee part of Manager is copied. ".... and gives the code above as .....
0
3682
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing problems have arisen. My investigations show that it is not related to the particular system I developed. but is affecting Access in general. So, has nothing to do with reports being set to print to a default printer (which they all are) or to a...
18
6197
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the strcat (mystract). Program below. However this appears not to have fixed the problem and I don't know why it shouldn't ? Any further help as to what else I am doing wrong will be appreciated regards
28
5253
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
2
4568
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
0
9963
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11525
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11293
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10659
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6077
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.