Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Why Cout() and Cerr() work so different?
Re: Why Cout() and Cerr() work so different? [message #44973 is a reply to message #44969] Wed, 05 August 2015 13:05 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
kov_serg wrote on Tue, 04 August 2015 23:43
Why this code outputs different lines of text? (OS:WinXP SP3 32bit Upp:8760)
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN 
{
	Cout()<<"ABCD - АБВГД\n";
	Cerr()<<"ABCD - АБВГД\n";
}

Output:
ABCD - АБВГД
ABCD - ╨Р╨С╨Т╨У╨Ф


index.php?t=getfile&id=4824&private=0


It is because different code is used for Cerr output. Cout performs character set conversion (UTF8->console OEM charset), Cerr does not.

The reason is that conversion has some bad properties and it was deemed unlikely that somebody outputs unicode to error output. We might have been wrong... Smile

Mirek
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous
Next Topic: Dehaviour of DirectoryExists
Goto Forum:
  


Current Time: Sun Jun 22 09:37:26 CEST 2025

Total time taken to generate the page: 0.03529 seconds