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

Encoding troubles

Hi,

I have problems with XML Encoding concerning special characters like é and
è.
I have set the processing instruction to UTF-16 and the file is saved as
UTF-16.
The XML is valid and well-formed, this isn't the problem.

I have 2 machines running exactly the same application (code is identical,
running under the same account) for parsing an XML. I gave both applications
the same XML-file.

Result:
The first application reads the é as é : correct
The second application reads the é as ?? : what is the matter here?

The unicode-regional settings are identical on both machines.

What did I miss?

Thx!

Jeroen db
Nov 12 '05 #1
6 1443


Jeroen De Brabander wrote:

I have problems with XML Encoding concerning special characters like é and
è.
I have set the processing instruction to UTF-16 and the file is saved as
UTF-16.
The XML is valid and well-formed, this isn't the problem.

I have 2 machines running exactly the same application (code is identical,
running under the same account) for parsing an XML. I gave both applications
the same XML-file.

Result:
The first application reads the é as é : correct
The second application reads the é as ?? : what is the matter here?


If you don't get an XML parse error about invalid characters then let us
assume the file is indeed properly UTF-16 encoded. What kind of
application is that, where/how do you try to output the characters read
from the XML? Is that an ASP.NET application that sends stuff to the
browser, or is it a Windows console application sending stuff to the
console window, or is it a WinForms GUI application displaying the
output in some control?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
Hi Martin,

Thx for your quick reply.

There are indeed no parse errors.

It is a webservice on WS2003 that parses the XML and creates SharePoint
websites from it.
The content of the XML is used to define title and description for the
websites.

On my testing machine the special characters are translated correctly, in
the live environment I get question marks.

Kind regards,

Jeroen De Brabander
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...


Jeroen De Brabander wrote:

I have problems with XML Encoding concerning special characters like é
and è.
I have set the processing instruction to UTF-16 and the file is saved as
UTF-16.
The XML is valid and well-formed, this isn't the problem.

I have 2 machines running exactly the same application (code is
identical, running under the same account) for parsing an XML. I gave
both applications the same XML-file.

Result:
The first application reads the é as é : correct
The second application reads the é as ?? : what is the matter here?


If you don't get an XML parse error about invalid characters then let us
assume the file is indeed properly UTF-16 encoded. What kind of
application is that, where/how do you try to output the characters read
from the XML? Is that an ASP.NET application that sends stuff to the
browser, or is it a Windows console application sending stuff to the
console window, or is it a WinForms GUI application displaying the output
in some control?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #3


Jeroen De Brabander wrote:

There are indeed no parse errors.

It is a webservice on WS2003 that parses the XML and creates SharePoint
websites from it.
The content of the XML is used to define title and description for the
websites.

On my testing machine the special characters are translated correctly, in
the live environment I get question marks.


I have no knowledge about Sharepoint but if you say web sites then the
ouput problem with the '??' is probably in a browser rendering those web
sites. Assuming the content is served over HTTP then you need to make
sure the output encoding SharePoint creates is transmitted to the
browser/client in a HTTP response header e.g. in ASP you would do
Response.ContentType = "text/html; charset=UTF-8"
for instance where of course the charset needs to be what the server
generates.
I don't think it is an XML problem really, if you can parse the XML
input fine then in your .NET code you should have strings with unicode
characters and the problem occurs later when your application creates
the output and probably then when the client/browser tries to render the
output.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #4

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...


Jeroen De Brabander wrote:

There are indeed no parse errors.

It is a webservice on WS2003 that parses the XML and creates SharePoint
websites from it.
The content of the XML is used to define title and description for the
websites.

On my testing machine the special characters are translated correctly, in
the live environment I get question marks.


I have no knowledge about Sharepoint but if you say web sites then the
ouput problem with the '??' is probably in a browser rendering those web
sites. Assuming the content is served over HTTP then you need to make sure
the output encoding SharePoint creates is transmitted to the
browser/client in a HTTP response header e.g. in ASP you would do
Response.ContentType = "text/html; charset=UTF-8"
for instance where of course the charset needs to be what the server
generates.
I don't think it is an XML problem really, if you can parse the XML input
fine then in your .NET code you should have strings with unicode
characters and the problem occurs later when your application creates the
output and probably then when the client/browser tries to render the
output.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Hi Martin,

If what you say is the case, than I can't explain why the rendering in my
test-environment is fine.
The test sharepoint environment is identical to the one in production.

If I watch the XML (the file), it is fine. I select the nodes en use the
string as input for the description/title fields.
In test it is ok, in production I get "??".

I agree with you that the problem probably is not the XML.
The only difference is that they're on a different machine ... Can there be
an influence of regional machine settings?

Thx for your support !

Jeroen db
Nov 12 '05 #5


Jeroen De Brabander wrote:

If I watch the XML (the file), it is fine. I select the nodes en use the
string as input for the description/title fields.
In test it is ok, in production I get "??".


Is the production site online so that you could post a URL where one can
see the problem?
Do you visit those Sharepoint sites with a web browser like MS IE or
Firefox?

If you agree it is not an XML problem then you could try to look for
help in a Sharepoint group or forum. In my understanding you can ignore
the XML, you have a string with certain characters and have problem to
get them rendered properly in a client as far as I understand.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #6
Hi Martin,

Unfortunately I can't give you a URL as it is not a public site. As client
we only use IE.
Strange thing is that when we access both test and production sites from one
single client machine, the testsite shows the correct é-values, the
productionsite shows ??.

So the problem is not:
- the XML-format
- the client

I start thinking that there is a language/regional settings-difference
between the 2 webservices (test/production). The webservice takes the values
from the XML (the XML is fine) and accepts the values in UTF-8 instead of
UTF-16 in case of the production environment. Maybe there is a difference in
configuration of IIS. I'll try to figure it out.

Thanks for the support, Martin !

Kind regards,

Jeroen db

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:ub**************@TK2MSFTNGP09.phx.gbl...


Jeroen De Brabander wrote:

If I watch the XML (the file), it is fine. I select the nodes en use the
string as input for the description/title fields.
In test it is ok, in production I get "??".


Is the production site online so that you could post a URL where one can
see the problem?
Do you visit those Sharepoint sites with a web browser like MS IE or
Firefox?

If you agree it is not an XML problem then you could try to look for help
in a Sharepoint group or forum. In my understanding you can ignore the
XML, you have a string with certain characters and have problem to get
them rendered properly in a client as far as I understand.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #7

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

Similar topics

2
by: Xaver Hinterhuber | last post by:
Hello pythonistas, I program a class which stores the source code for an output page in a string. At request time it compiles it, executes it and returns the result. I now have upgraded the...
7
by: Erik Bethke | last post by:
Hello All, I have found much help in the google archives but I am still stuck... here is my code snippet: path = os.getcwd() path = path.decode('UTF8') Now the trouble is I am getting that...
9
by: Ksenia Marasanova | last post by:
Hi, I have a little problem with encoding. Was hoping maybe anyone can help me to solve it. There is some amount of data in a database (PG) that must be inserted into Excel sheet and emailed....
0
by: lmckaha | last post by:
Hi, Mysql version: 3.23.49 Solaris version: 2.7 gcc compiler version: 2.95.2 Python : 2.2.2 I'm evaluating the C and C++ API to decide which one to bye but I have many troubles.
6
by: jmgonet | last post by:
Hello everybody, I'm having troubles loading a Xml string encoded in UTF-8. If I try this code: ------------------------------ XmlDocument doc=new XmlDocument(); String s="<?xml...
4
by: fitsch | last post by:
Hi, I am trying to write a generic RSS/Atom/OPML feed client. The problem is, that those xml feeds may have different encodings: - <?xml version="1.0" encoding="ISO-8859-1" ?>... - <?xml...
0
by: Michal | last post by:
I have troubles with instaling .Net Framework 2.0 (Beta 2 - 2.0.50215). The main instalation went just fine, troubles begin with my attemt to run aspnet_regiss.exe -i. Asp.Net is instaled into IIS...
1
by: Brad Wood | last post by:
I am testing a web service that returns an XML doc as a string. I went through troubles when developing it whereby the saved output of the service would not display in Internet Explorer due to...
12
by: Atlas | last post by:
I'm working on a multilanguage ASP/HTML site using a IIS6 web server. It perfectly works with two languages (english and italian) in this way: - basically the same ASP code for every language -...
0
by: JohnIdol | last post by:
VC++6 to VC++2003 - linking troubles -------------------------------------------------------------------------------- Hi All, I successfully ported an application from VC++6 to VS2003. Solved...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.