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 7927187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:11:00+00:00 2026-06-03T19:11:00+00:00

Possible Duplicate: To which character encoding (Unicode version) set does a char object correspond?

  • 0

Possible Duplicate:
To which character encoding (Unicode version) set does a char object correspond?

I’m a little afraid to ask this, as I’m sure its been asked before, but I can’t find it. Its probably something obvious, but I’ve never studied encoding before.

int Convert(char c)
{
    return (int)c;
}

What encoding is produced by that method? I thought it might be ASCII (at least for <128), but doing the code below produced… smiley faces as the first characters? What? Definitely not ASCII…

for (int i = 0; i < 128; i++)
    Console.WriteLine(i + ": " + (char)i);
  • 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-03T19:11:02+00:00Added an answer on June 3, 2026 at 7:11 pm

    C# char uses the UTF-16 encoding. The language specification, 1.3 Types and variables, says:

    Character and string processing in C# uses Unicode encoding. The char type represents a UTF-16 code unit, and the string type represents a sequence of UTF-16 code units.

    UTF-16 overlaps with ASCII in that the character codes in the ASCII range 0-127 mean the same thing in UTF-16 as in ASCII. The smiley faces in your program’s output are presumably how your console interprets the non-printable characters in the range 0-31.

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

Sidebar

Related Questions

Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I
Possible Duplicate: Which version of Perl should I use on Windows? I want to
Possible Duplicate: Custom Character recognition for android I have some camera shots which contains
Possible Duplicate: Which collection for storing unique strings? I am currently using a Dictionary<string,
Possible Duplicate: Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc. I
Possible Duplicate: C++ STL: Which method of iteration over a STL container is better?
Possible Duplicate: C#: Passing null to overloaded method - which method is called? Here
Possible Duplicate: Android Layout and positioning issue Design layout which support for all kind
Possible Duplicate: A better way to compare Strings which could be null I have
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the

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.