Board index » delphi » Langauge specific chars

Langauge specific chars


2008-01-03 06:05:05 AM
delphi171
Hi!
The TXMLDocument component don't seems to be able to load xml files with
swedish land specific characters like "?, "? and "?.
The application raises an EDOMParseError saying "An invalid character was
found in the text content". When I replace these characters with "a" and "o"
it all works fine.
Does anyone know a solution to this?
Niklas Larsson
 
 

Re:Langauge specific chars

What encoding used in your xml-file?
"Niklas Larsson" <XXXX@XXXXX.COM>writes
Quote
Hi!

The TXMLDocument component don't seems to be able to load xml files with
swedish land specific characters like "?, "? and "?.

The application raises an EDOMParseError saying "An invalid character was
found in the text content". When I replace these characters with "a" and
"o"
it all works fine.

Does anyone know a solution to this?


Niklas Larsson



 

Re:Langauge specific chars

Hi Mike!
The xml file uses utf-8.
/Niklas
"Mike Shkolnik" <XXXX@XXXXX.COM>writes
Quote
What encoding used in your xml-file?

--
With best regards, Mike Shkolnik
Scalabium Software
www.scalabium.com
XXXX@XXXXX.COM

"Niklas Larsson" <XXXX@XXXXX.COM>writes
news:477c0b2a$XXXX@XXXXX.COM...
>Hi!
>
>The TXMLDocument component don't seems to be able to load xml files with
>swedish land specific characters like "?, "? and "?.
>
>The application raises an EDOMParseError saying "An invalid character was
>found in the text content". When I replace these characters with "a" and
"o"
>it all works fine.
>
>Does anyone know a solution to this?
>
>
>Niklas Larsson
>
>
>


 

Re:Langauge specific chars

"Niklas Larsson" <XXXX@XXXXX.COM>writes
Quote
The xml file uses utf-8.
If those Swedish characters are appearing in the XML as-is, then your XML is
malformed. They are not valid UTF-8 characters and must be encoded
accordingly.
Gambi
 

Re:Langauge specific chars

Thanks Gambi!
Yes, they are appearing as-is.
The XML file is originally created in a third party delphi component and is
a report definition. Some way that component can load the file even if it
includes named characters.
Niklas
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Niklas Larsson" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>The xml file uses utf-8.

If those Swedish characters are appearing in the XML as-is, then your XML
is malformed. They are not valid UTF-8 characters and must be encoded
accordingly.


Gambi

 

Re:Langauge specific chars

"Niklas Larsson" <XXXX@XXXXX.COM>writes
Quote
The XML file is originally created in a third party delphi
component and is a report definition.
Then that component is buggy. It is setting the XML to say that it contains
UTF-8 data, but it really doesn't. It is not encoding its data properly,
which suggests to me that it is generating the XML manually instead of using
a real XML engine.
Quote
Some way that component can load the file even if it includes
named characters.
It is likely just ignoring the encoding and using the data as-is, which is
not the correct way to work with XML in general.
Gambit
 

Re:Langauge specific chars

"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

It is likely just ignoring the encoding and using the data as-is, which is
not the correct way to work with XML in general.
Maybe a bit controversial to ask but can the encoding be ignored in the same
way using the TXMLDocument component? I am only interested in one attribute
in the XML definition that holds an ADO connectionsstring. The tool I'm
writing is a kind of "deployment wizard" where I alter the report
connectionstring to the new DB environment without have to load the report
itself.
/Niklas
 

Re:Langauge specific chars

"Niklas Larsson" <XXXX@XXXXX.COM>writes
Quote
Maybe a bit controversial to ask but can the encoding be ignored
in the same way using the TXMLDocument component?
No. Like a good XML engine should, it validates and honors the specified
encoding. You would have to parse the XML manually.
Gambit