Quantcast
Channel: Non-unicode XML representation - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Non-unicode XML representation

$
0
0

I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?

E.g.

<?xml version="1.0" encoding="utf-8"?><xml><value>受</value></xml>

to

<?xml version="1.0" encoding="Windows-1252"?><xml><value>&#27544;</value></xml>

I deserialize the XML and then attempt to serialize it using XmlTextWriter specifying the Default encoding (Default is Windows-1252). All the unicode characters end up as question marks. I'm using VS 2008, C# 3.5


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>