Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:56:37+00:00 2026-05-31T10:56:37+00:00

I have a language that generally contains serialised data messages in a human-readable format,

  • 0

I have a language that generally contains serialised data messages in a human-readable format, but some productions within the language contain verbatim raw, binary data.

My parser uses String for its buffer since that seems to be the easiest thing to work with. However the data is read from a network socket into an array of Byte.

Now, I’m trying to connect the dots between Byte() and String:

' data as Byte()
' count as Integer
' buffer as String

buffer += System.Text.Encoding.ASCII.GetString(data, 0, count)

But my initial assumption that an ASCII encoding would just leave my bytes alone turned out to be invalid; any bytes with a value that doesn’t fit into the 7-bit model was translated into '?'.

So then I thought about using a single-byte “Unicode” encoding that should leave my bytes alone but also allow values throughout the 8-bit range:

' data as Byte()
' count as Integer
' buffer as String

Dim enc = New System.Text.UTF8Encoding
buffer += enc.GetString(data, 0, count)

But my data is still mangled. I haven’t actually been able to deduce yet precisely how the data is being mangled, but I do know that the length of the data is changing, indicating that the bytes are not being left verbatim.

So how can I obtain a String whose contents are just a verbatim copy of the bytes from my Bytes() input?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:56:38+00:00Added an answer on May 31, 2026 at 10:56 am

    Based on our comment discussion it seems like you want to see the Byte instances in the abscence of an encoding. If this is the case you should consider using List(Of Byte) instead of String

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that contains localized language strings that is currently encoded
I want to generate random numbers manually. I know that every language have the
I have a legacy Java (not my native language) app that I'm trying to
I have a book, Essential ActionScript 3 (O'Reilly), to learn about using that language.
I have found myself designing a language for fun that is a cross between
I have an English language forum site written in perl that is continually bombarded
I have a multiple language website, that uses subdirectories from the root ('/en' for
I am using java language,I have a method that is supposed to return an
I have read in a lot of places that assembly language is not usually
Okay, so I'm using perl to read in a file that contains some general

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.