Re: Unable to translate Unicode character \u00E9 at index 5409 to specified code page.
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Wed, 20 Jun 2007 17:05:24 +0200
Les Caudle wrote:
I've got some C# 2.0 code that has been working for a year.
using (XmlWriter w = XmlWriter.Create("out.xml" ,settings)) {
// many lines of code to write to w w.WriteStartElement("contactTypeRef");
Suddently, I'm getting this 100% repeatable error:
************** Exception Text **************
System.Text.EncoderFallbackException: Unable to translate Unicode character
\u00E9 at index 5409 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown,
Int32 index)
at System.Xml.CharEntityEncoderFallbackBuffer.Fallback(Char charUnknown,
Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
at System.Text.ASCIIEncoding.GetBytes(Char* chars, Int32 charCount, Byte*
bytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.Convert(Char* chars, Int32 charCount, Byte* bytes,
Int32 byteCount, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean&
completed)
at System.Text.EncoderNLS.Convert(Char[] chars, Int32 charIndex, Int32
charCount, Byte[] bytes, Int32 byteIndex, Int32 byteCount, Boolean flush, Int32&
charsUsed, Int32& bytesUsed, Boolean& completed)
at System.Xml.XmlEncodedRawTextWriter.EncodeChars(Int32 startOffset, Int32
endOffset, Boolean writeAllToStream)
at System.Xml.XmlEncodedRawTextWriter.FlushBuffer()
at System.Xml.XmlEncodedRawTextWriter.RawText(Char* pSrcBegin, Char* pSrcEnd)
at System.Xml.XmlEncodedRawTextWriter.RawText(String s)
at System.Xml.XmlEncodedRawTextWriter.WriteStartElement(String prefix, String
localName, String ns)
at System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String
localName, String ns)
at System.Xml.XmlWriter.WriteStartElement(String localName)
I thought the whole point of using an XmlWriter was that it would translate the
chars into legal XML.
Are you perhaps trying to write out XML in an encoding like US-ASCII that does not include the character 'é'?
What are you XmlWriterSettings exactly when you get that error?
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.
- Follow-Ups:
- References:
- Prev by Date: Unable to translate Unicode character \u00E9 at index 5409 to specified code page.
- Next by Date: Re: Unable to translate Unicode character \u00E9 at index 5409 to specified code page.
- Previous by thread: Unable to translate Unicode character \u00E9 at index 5409 to specified code page.
- Next by thread: Re: Unable to translate Unicode character \u00E9 at index 5409 to specified code page.
- Index(es):
Relevant Pages
|