Link to home
Start Free TrialLog in
Avatar of anda
anda

asked on

ASP.NET 2.0 website fails on open - unable to translate Unicode character

I am running Windows XP SP2. I recently installed Visual Studio 2005 Standard Edition. I created a new website and put a single gridview control on it that is linked to an ms access database. I wrote no code. When I try to open the website I get the following error message:

Unable to translate Unicode character \uDF5D at index 1 to specified code page.

I don't know if it is relevant, but I had previously installed the Visual Studio 2005 Professional 90 day demo, whick I uninstalled before installing the Standard version.

Thank you for any assistance,

Eva

Avatar of nehaya
nehaya

-I don't think this is beacuse of demo thing, it's really different.

-in this page:
http://msdn2.microsoft.com/en-us/library/system.text.encoderexceptionfallback.aspx

I found these lines:
"However, an encoding operation can fail if the input character cannot be represented by the encoding. For example, an ASCIIEncoding object cannot encode a character whose Unicode code point value is outside the range U+0000 to U+007F. "

-Do you use latin-only in your databases?
-Does your mdb filename has any non-latin characters?

Regards,
Nehaya

- Does your project files names in latin-chars ?

If possible, give us the line where this error occured to discuss further.

Regards,
Nehaya
Avatar of anda

ASKER

Nehaya,

Thank you for your response. The access mdb is named Current Data.mdb and the data in it does not contain non-Latin characters. The full text of the error message is:

Server Error in '/WMSWebLookup' Application.
--------------------------------------------------------------------------------

Unable to translate Unicode character \uDF5D at index 1 to specified code page.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Text.EncoderFallbackException: Unable to translate Unicode character \uDF5D at index 1 to specified code page.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[EncoderFallbackException: Unable to translate Unicode character \uDF5D at index 1 to specified code page.]
   System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index) +156
   System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars) +267
   System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder) +2828709
   System.Text.UTF8Encoding.GetByteCount(String chars) +45
   System.IO.BinaryWriter.Write(String value) +38
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +406

[ArgumentException: Error serializing value '1.479.2733' of type 'System.String.']
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +4860
   System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +140
   System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +93
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +30
   System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +52
   System.Web.UI.HiddenFieldPageStatePersister.Save() +125
   System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +148
   System.Web.UI.Page.SaveAllState() +979
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5016



--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
ASKER CERTIFIED SOLUTION
Avatar of nehaya
nehaya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anda

ASKER

Nehaya,

The problem was in the data - it contained numerous unprintable characters. After editing them out the site opened properly. Many thanks.

Eva