Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. urgent help required

urgent help required

Scheduled Pinned Locked Moved C#
helpquestioncsharp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Venkatraman
    wrote on last edited by
    #1

    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)

    S 1 Reply Last reply
    0
    • V Venkatraman

      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)

      S Offline
      S Offline
      shaunAustin
      wrote on last edited by
      #2

      Venkatraman, You could use System.IO.Stream to access the file byte by byte you could then user myStream.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

      V 1 Reply Last reply
      0
      • S shaunAustin

        Venkatraman, You could use System.IO.Stream to access the file byte by byte you could then user myStream.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

        V Offline
        V Offline
        Venkatraman
        wrote on last edited by
        #3

        I 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)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups