
Hello, I compiled a c++ rpm install program which gives some strange/unexpected output while using cout. I have consulted several sources, but untill now no success. The output I get is the following: After unpacking 11.2MB of additional disk space will be used. \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ Executing RPM (-Uvh)... Preparing... ########################################### [100%] 1:python-devel ########################################### [100%] or Do you want to continue? [Y/n] \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ \?x×Bèÿ¿ÀT?@àçÿ¿ØÿX@èçÿ¿mBM@ Executing RPM (-Uvh)... ?èÿ¿Za0 The involved code looks as follows: { ...... const char *operation; .... case Item::RPMUpgrade: if (Interactive) operation = "-Uvh"; else operation = "-Uv"; break; .... cout << _("Executing RPM (")<<operation<<")..." << endl; For the record: The exact same source has been used on suse-8.2 as well, and it did not show the problem. The compilation and execution has been performed with different LANG= settings. They do not seem to matter. The problem persist if cout is altered for cerr. If a "\n" is added to the variable operation as follows: case Item::RPMUpgrade: if (Interactive) operation = "-Uvh\n"; else operation = "-Uv"; break; ...... cout << "Executing RPM (" << operation << ")..." << endl; The output is now: Executing RPM (-Uvh@,¤E@è´B@0@8ȸçÿ¿0@ )... Or if the variable is assigned an empty string the following result is obtained: After unpacking 11.5kB of additional disk space will be used. RPM version 4.1.1/F@,¤E@è´B@0@8ȸçÿ¿0@ <<<<<<=========== Copyright (C) 1998-2002 - Red Hat, Inc. This program may be freely redistributed under the terms of the GNU GPL Does anyone know what the cause of this behaviour can be? Incorrect programming? Is the definition of the variable incorrect, something else?? -- TIA, Richard Bos Without a home the journey is endless