SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 Unable to translate Unicode character
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SP
Starting Member

USA
2 Posts

Posted - 03/01/2012 :  11:02:37  Show Profile  Reply with Quote
I got this error when I tried to connect a gridview to a sqldatasource using visual web developer. I've been building a website for months on a stand alone computer with sql srvr 08 express and VWD without any issues until now when I got the below error. Can anyone help?
Unable to translate Unicode character \uD8FF at index 0 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 \uD8FF at index 0 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 \uD8FF at index 0 to specified code page.]
System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index) +155
System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars) +275
System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder) +7680574
System.Text.UTF8Encoding.GetByteCount(String chars) +43
System.IO.BinaryWriter.Write(String value) +38
System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +1281

[ArgumentException: Error serializing value '?????Aa???????*D
EdGÐ
IE EJelI in?R? ? U? ? ? ?U? F? ? ? ? ? ? ?†††††???N??????II?????†????????????8d????? ?? 2?? ??????? ? ?^?
???? ? ? Y?˜??????? ??? C? ?? ??????
?#
?????????8?????????8

s
??n?* ? n O
RTUU
z? ?(????
|?a?u? ??A????A?? ?? ?
¨???R?????††††??†??†???E????†††††††††† ††††††††† ??†††† ??††††dd????††† ????????????† a E?e;I ? ††††††††††††††††††††††††††††††††††††††††††††††††††††††††††† a E?e?I ? ?? ?II???????????????????????????????????U??????????????????????????????????x???d?!?#162;AaaaA^...' of type 'System.String.']
System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3319
System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +110
System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +57
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
System.Web.UI.HiddenFieldPageStatePersister.Save() +79
System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +105
System.Web.UI.Page.SaveAllState() +236
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099

Edited by - SP on 03/01/2012 11:22:24

SP
Starting Member

USA
2 Posts

Posted - 03/07/2012 :  10:28:18  Show Profile  Reply with Quote
I have found the problem and solved it. The error came when I was attempting to write some code that would store an image path that should have looked like this: ~/Images/nameofimage.bmp using a data type of nvarchar(max). Instead it created a bunch of rectangles and foreign characters (??????? Aa) that the unicode could not translate hence causing the error.
So the entire problem was based in the database table due to some improper code on my part that caused/allowed some odd characters to be stored in the table where the Unicode character could not be translated. I deleted the row in the table and everything is working correctly again now.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000