Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2004, 05:34 PM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rosalynb
Default "Found a low surrogate char without a preceding hi

Guys,

any suggestion for this error!
"Found a low surrogate char without a preceding
high surrogate at index: 738"
so far I know this much "it sounds like there was an invalid combination of bytes
in the string. A UTF-16 string uses two bytes (16 bits)
to encode characters. Some of the byte combinations are
reserved (apparently) and can't be used in a UTF-16 string."

any idea except try and catch to just skip it?
__________________
--------------------
Thanks
Rose
[email protected]
 
Old May 17th, 2004, 06:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What is the value that is causing the error, at index 738?
 
Old May 17th, 2004, 07:21 PM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rosalynb
Default

"\0\0\0\0\0\0\0\0\0\0\0\0\0\bi\0\0\0\0\0\0\b\0\0 M\t\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\b#1428;\0\0MR\0\5555 test WAY"

looks like that but kind of longer...
 
Old May 18th, 2004, 08:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What is that coming from? Do all of the lines of data look like this?
 
Old May 18th, 2004, 12:41 PM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rosalynb
Default

Yes, but it works for some of them. I mean it writes the data into the error file but when it gets to this line for example, it throws the above exception. by the way I am using Streamwriter for writing this data too. I read somewhere it cuases the problem too.
any idea?
 
Old May 18th, 2004, 01:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

In one of the constructors for the StreamWriter class, there is an object of type System.Text.Encoding. Try a different encoding type, and see if that works.
 
Old May 18th, 2004, 06:48 PM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rosalynb
Default

worked as a charm. thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Surrogate ssaranam SQL Server 2005 1 December 14th, 2007 02:32 AM
Big challenge here! How to convert char* to char^? samiswt Visual C++ 2005 1 November 30th, 2007 09:09 PM
Check for items with low values adias SQL Language 0 May 5th, 2006 02:01 PM
High Low Card Game vtvb VB.NET 2002/2003 Basics 1 September 23rd, 2005 01:21 PM
COM Surrogate crmpicco Classic ASP Basics 7 May 12th, 2005 09:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.