[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1104
  • Last Modified:

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

0
anda
Asked:
anda
  • 3
  • 2
1 Solution
 
nehayaCommented:
-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

0
 
nehayaCommented:
- Does your project files names in latin-chars ?

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

Regards,
Nehaya
0
 
andaAuthor Commented:
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
0
 
nehayaCommented:
Maybe this is the line of the error??!
[ArgumentException: Error serializing value '1.479.2733' of type 'System.String.']

What is the content of ur database?
(big numbers, long texts...)
It seems that a value of 1.479.2733 is causing this exception to occur..
try to remove this value from your db (just for now) and try again..


P.S. It's really better to use SqlServer instead of Access, think about it! BTW: Express Edition is FREE!


Regards,
Nehaya
0
 
andaAuthor Commented:
Nehaya,

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

Eva
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now