CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Posts
    6

    converting 16bit strings to 8bit

    I'm using LineNumberReader to read lines from a textfile. Everything works cool, but recently I tried to read a windows text file, which seems to be 16bit unicode or something like that. Every character is represented by 2 bytes... no, it's not a .doc file or something, it's plain text.

    Now, I need to convert the String to a "normal" 8bit String, so that my following functions can work with this textfile. I could'nt find a function to do this. For now, I'm converting the String by manually copying every second character to another String.

    Is there a more handy way to do this?

    Thanks!




  2. #2
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: converting 16bit strings to 8bit


    Use RandomAccessFile.


  3. #3
    Join Date
    Sep 1999
    Posts
    6

    Re: converting 16bit strings to 8bit

    Well, I'm checking those strings character for character anyway. I just thought there would be a function to do this.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured