public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54527] New: wcout breaks on win32 console
@ 2012-09-08 14:13 vurentjie at gmail dot com
  2012-09-08 14:19 ` [Bug c++/54527] " vurentjie at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vurentjie at gmail dot com @ 2012-09-08 14:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54527

             Bug #: 54527
           Summary: wcout breaks on win32 console
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vurentjie@gmail.com


this case does not seem to work... 

the wide character does not print, nor does the "...done" part, 

this is only an issue for windows console...

#include <windows.h>
#include <iostream>

int main(int argc, char** argv){

    SetConsoleOutputCP(1200);

    wchar_t out[3]={0,0x000a,wchar_t()};
    int characters = 1000;

    while(characters--){
        out[0]=wchar_t(characters);
        std::wcout << out << "...done";
    }

}


...this case does work however, and where no glyph is found for the character
the square replacement is used


#include <windows.h>
#include <iostream>

int main(int argc, char** argv){

    SetConsoleOutputCP(1200);

    wchar_t out[10]={0,0x000a,'.','.','.','d','o','n','e',wchar_t()};
    int characters = 1000;

   HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD n;
    while(characters--){
        out[0]=wchar_t(characters);
        WriteConsoleW( stdout, out, 10, &n, NULL );
    }

    return 0;

}



i am not sure if this has anything to do with the default locale, 

or how to fix it without resorting to windows-specific api instead of
std::wcout


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/54527] wcout breaks on win32 console
  2012-09-08 14:13 [Bug c++/54527] New: wcout breaks on win32 console vurentjie at gmail dot com
@ 2012-09-08 14:19 ` vurentjie at gmail dot com
  2012-09-09  7:23 ` vurentjie at gmail dot com
  2012-09-09  7:25 ` vurentjie at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vurentjie at gmail dot com @ 2012-09-08 14:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54527

--- Comment #1 from vurentjie <vurentjie at gmail dot com> 2012-09-08 14:19:45 UTC ---
i did try follow this deeper, but the __ostream_insert specialization for
wchar_t is not in ostream_insert.h,

but it seems to be declared in ostream-inst.cc (libstd++ implementation)

i may decide to look further but first want to hear if there is something i am
missing


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/54527] wcout breaks on win32 console
  2012-09-08 14:13 [Bug c++/54527] New: wcout breaks on win32 console vurentjie at gmail dot com
  2012-09-08 14:19 ` [Bug c++/54527] " vurentjie at gmail dot com
@ 2012-09-09  7:23 ` vurentjie at gmail dot com
  2012-09-09  7:25 ` vurentjie at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vurentjie at gmail dot com @ 2012-09-09  7:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54527

vurentjie <vurentjie at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |enhancement


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/54527] wcout breaks on win32 console
  2012-09-08 14:13 [Bug c++/54527] New: wcout breaks on win32 console vurentjie at gmail dot com
  2012-09-08 14:19 ` [Bug c++/54527] " vurentjie at gmail dot com
  2012-09-09  7:23 ` vurentjie at gmail dot com
@ 2012-09-09  7:25 ` vurentjie at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vurentjie at gmail dot com @ 2012-09-09  7:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54527

vurentjie <vurentjie at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from vurentjie <vurentjie at gmail dot com> 2012-09-09 07:25:24 UTC ---
nevermind


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-09  7:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-08 14:13 [Bug c++/54527] New: wcout breaks on win32 console vurentjie at gmail dot com
2012-09-08 14:19 ` [Bug c++/54527] " vurentjie at gmail dot com
2012-09-09  7:23 ` vurentjie at gmail dot com
2012-09-09  7:25 ` vurentjie at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).