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

  • Home
  • SEARCH
  • 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 8405063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:45:19+00:00 2026-06-09T22:45:19+00:00

Why is the output different between Console and Debug? byte [] data = new

  • 0

Why is the output different between Console and Debug?

byte [] data = new byte [] {0xB1, 0x00,0xA6,0x7C, 0x4e, 0xEC, 0xE7, 0xFF, 0xDD, 0xCE};

Console.WriteLine (new String(Encoding.GetEncoding("ISO-8859-1").GetChars(data)));
Console.WriteLine (Encoding.UTF8.GetString(data));

Debug.WriteLine (new String(Encoding.GetEncoding("ISO-8859-1").GetChars(data)));
Debug.WriteLine (new String(Encoding.UTF8.GetChars(data)));

“Console.WriteLine” (Latin1 encoding) output -> ±¦|NìçÿÝÎ

“Console.WriteLine” (UTF8) output -> ��|N�����

“Debug.WriteLine” shows no output.

  • 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-06-09T22:45:21+00:00Added an answer on June 9, 2026 at 10:45 pm

    You have a 0x00 in the second position of the array, which is, as you know, a string end. Debug.WriteLine outputs in the ASCII encoding. Therefore, it outputs only the first byte in the Output window.

    If you change 0x00 to 0x01 you will see the full output.

    MORE When I look at new String(Encoding.GetEncoding("ISO-8859-1").GetChars(data)) in the Watch window I see an exception being thrown:

    'new String(Encoding.GetEncoding("ISO-8859-1").GetChars(data))' threw an exception of type 'System.ArgumentException' string {System.ArgumentException}

    This usually happens when attempting to access an Array element that doesn’t exist.

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

Sidebar

Related Questions

I would like to output debug messages in my django app at different points
Can anyone explain the difference between the Ruby on Rails console output and the
What's the best way to output different types of responses f.ex xml, json, html,
I get different output when mocking a class once and when mocking a class
This code produces a different output in Python 2 and Python 3 . class
I've seen some questions on deciding the best OCR result given output from different
I have different php output in jQuery-based tabs. This output is formed from database
Is there a way to instruct c# compiler to output source at different stages
I need a method to redirect my Mac's audio output to a different computer
I'm using Hadoop 0.20.203.0. I want to output to two different files, so I'm

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.