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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:06:00+00:00 2026-05-10T22:06:00+00:00

In an Xcode project, if I use std::cout to write to the console the

  • 0

In an Xcode project, if I use std::cout to write to the console the output is fine.

However, if I use std::wcout I get no output.

I know that this is a thorny issue in C++, and I’ve been googling around to try and find a specific solution in the Xcode case. A couple of things I found that it was suggested should work were:

std::cout.imbue( std::locale('') ); 

and

std::setlocale(LC_ALL, ''); 

Neither of these have made any difference. Before I resign myself to spending the next couple of weeks studying the facets API just to be able to write to the console I thought I’d check with the esteemed audience here.

[Update]

I think the reason for the problem I’ve been having is actually to do with the specific encoding of some of the strings I’m trying to print.

If I send just a string literal, using the L'my string' syntax it works! It appears this is using UTF32 – little endian encoding.

However, I’ve been mixing this with strings I’ve been passed from Objective C++ code using NSUTF32BigEndianStringEncoding encoding. It’s this mix of encodings that’s causing the problems.

I think we can consider this matter closed. Thanks for reading.

  • 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. 2026-05-10T22:06:00+00:00Added an answer on May 10, 2026 at 10:06 pm

    std::wcout should work just like std::cout.

    The following works fine on my MAC:

    #include <iostream>  int main() {     std::cout << 'HI' << std::endl;     std::wcout << L'PLOP' << std::endl; } 

    Maybe (though some code would have been nice) its because you are not flushing the buffer. Remember that std::cout and std::wcout are buffered. This means the output will not be pushed to the console until the buffer is filled or you explicitly flush the buffer.

    You can flush the buffer with:

    std::wcout << flush(); // or std::wcout << endl;  // Those also puts a '\n' on the stream. 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use glew in my Xcode project, but I'm getting this: Apple
I use a statically linked library for Sqlite in an iPhone Xcode project. I
I don't understand why if I open a project in xcode I can use
I am trying to use XMPPFramework with an iOS5 project (ARC) under xcode 4.2.1
A minimal illustrative Xcode project for this is available on github . On my
I'm trying to use standard system header files in my C++ XCode project: #include
How do I use a relative path in Xcode project settings?
In my Xcode project, I want to use X11 framework. X11 is installed on
I was just trying to use Xcode for a very small C++ project, and
I have two frameworks in my Xcode project that both define a class with

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.