urgent help required
-
hello i am again on today, take my question, i have a fixed length file which has basically some ship to records. in those records i have got japanese characters also. Since it is a fixed length file, i wanted to extract data by specifying width. The problem is some japanese characters occupies more than one byte, in those scenarios if i use substring function i am not extracting correct information. say suppose you need to extract 32 bytes of data from a string. if i do char by char opperation i will end up extracting information from other fields. my question is how do i read a string byte by byte in C#. please help me thanks Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude" Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)
-
hello i am again on today, take my question, i have a fixed length file which has basically some ship to records. in those records i have got japanese characters also. Since it is a fixed length file, i wanted to extract data by specifying width. The problem is some japanese characters occupies more than one byte, in those scenarios if i use substring function i am not extracting correct information. say suppose you need to extract 32 bytes of data from a string. if i do char by char opperation i will end up extracting information from other fields. my question is how do i read a string byte by byte in C#. please help me thanks Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude" Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)
Venkatraman, You could use
System.IO.Stream
to access the file byte by byte you could then usermyStream.ReadByte()
which returns an unsigned byte cast to an Int32 or -1 if the end of the stream! HTH Shaun :-D ----------------------------------------------------------------------- Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!! :-D -
Venkatraman, You could use
System.IO.Stream
to access the file byte by byte you could then usermyStream.ReadByte()
which returns an unsigned byte cast to an Int32 or -1 if the end of the stream! HTH Shaun :-D ----------------------------------------------------------------------- Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!! :-DI would like to know how to extract bytes from a string. Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude" Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)