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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:55:03+00:00 2026-06-13T08:55:03+00:00

Possible Duplicate: How to Output Unicode Strings on the Windows Console I try to

  • 0

Possible Duplicate:
How to Output Unicode Strings on the Windows Console

I try to output UTF-16 charachters to console in win32console application, but i cannot change the encoding of output stream, I try to use SetConsoleOutputCP() function but when i use next code for testing

    std::wcout << GetConsoleOutputCP() << std::endl;//output 866
    SetConsoleOutputCP(CP_WINUNICODE);              //if i set CP_UTF8 it works
    std::wcout << GetConsoleOutputCP() << std::endl;//output 866

I get the same result (866) for two cases. When I’m try to set CP_UTF8 it works correct but I need UTF-16, why my attempt is failed and how can I set output stream’s encoding to UTF-16?

  • 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-13T08:55:04+00:00Added an answer on June 13, 2026 at 8:55 am

    You cannot set the encoding to UTF-16 because both, cout and wcout, write to the same byte-oriented stream (STD_OUTPUT_HANDLE) and only byte-oriented encodings are supported. UTF-16 is word oriented. This implies that the only Unicode encoding that can be written to the standard output is UTF-8.

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

Sidebar

Related Questions

Possible Duplicate: Colorize stdout output to Windows cmd.exe from console C++ app I am
Possible Duplicate: Copy to Output Directory copies folder structure but only want to copy
Possible Duplicate: Able to see a variable in print_r()'s output, but not sure how
Possible Duplicate: Able to see a variable in print_r()'s output, but not sure how
Possible Duplicate: Windows Vista/7: How to sample output audio mix? How to record what-you-hear
Possible Duplicate: DOS command to Display result on console and redirect the output to
Possible Duplicate: Copy to Output Directory copies folder structure but only want to copy
Possible Duplicate: C# String output: format or concat? Console.WriteLine(Hi there, {0} {1}!, userName, userSurname);
Possible Duplicate: Rails console, how to stop output of return value? Consider this session
Possible Duplicate: strange output in comparision of float with float literal Comparison of float

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.