Thanks people..going through all these options...let hope it fixes it...i'll
keep you informed..

 

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com]
On Behalf Of Greg Keogh
Sent: Tuesday, 10 September 2013 2:48 PM
To: ozDotNet
Subject: Re: out of memory..urgent

 

This is the utf8 validation I was thinking of -- Greg

 

http://msdn.microsoft.com/en-us/library/302sbf78.aspx

 

On 10 September 2013 14:00, <osjasonrobe...@gmail.com> wrote:

Not sure if it's of use in this case but you can use char.GetUnicodeCategory
to check validity of a Unicode character

 

var validCharacter = 'q';

var ucCategory = char.GetUnicodeCategory(validCharacter);

var isValidUnicode = ucCategory != UnicodeCategory.OtherNotAssigned;  

 

 

var invalidCharacter = (char) 888;

ucCategory = char.GetUnicodeCategory(invalidCharacter);

isValidUnicode = ucCategory != UnicodeCategory.OtherNotAssigned;

 

Jason Roberts
Journeyman Software Developer

Twitter: @robertsjason
Blog: http://DontCodeTired.com
Pluralsight Courses: http://bit.ly/psjasonroberts

 

From: Greg Keogh
Sent: Tuesday, 10 September 2013 11:36 AM
To: ozDotNet

 

Does the byte[] actually represent a valid utf-8 string? There are ways of
validating, but I can't remember off the top of my head. You can also code
Encoding.UTF8.Getstring() as there is a static member for convenience --
Greg

 

On 10 September 2013 13:04, <anthonyatsmall...@mail.com> wrote:

Getting out of memory exception when I try to

 

Dim s as string

Dim b() as Byte

 

s=System.Text.Encoding.GetEncoding("utf-8).GetString(b) 

 

Definitely something about the length of b..works fine most of the time
except if b length is very large

 

Anthony

Melbourne StuffUps.learn from others, share with others!

http://www.meetup.com/Melbourne-Ideas-Incubator-Stuffups-Failed-Startups/


----------------------------------------------------------------------------
------
NOTICE : The information contained in this electronic mail message is
privileged and confidential, and is intended only for use of the addressee.
If you are not the intended recipient, you are hereby notified that any
disclosure, reproduction, distribution or other use of this communication is
strictly prohibited. 
If you have received this communication in error, please notify the sender
by reply transmission and delete the message without copying or disclosing
it. (*13POrtC*)
----------------------------------------------------------------------------
------- 

 

 

 

Reply via email to