Powered By Blogger

Monday, October 17, 2011

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

This error will come when we are doing some data encoding in HTML encoding in ASP.net. The following code is solution for the same...


string asAscii = Encoding.ASCII.GetString(
Encoding.Convert(
Encoding.UTF8,
Encoding.GetEncoding(
Encoding.ASCII.EncodingName,
new EncoderReplacementFallback(string.Empty),
new DecoderExceptionFallback()
),
Encoding.UTF8.GetBytes(line)
)

this might be save your time.....

Happy Coding..

Thanks,
Rajesh

No comments: