News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Problem with accentuated characters in build messages window

Started by skirby, April 28, 2007, 11:14:17 PM

Previous topic - Next topic

skirby

Hello,

I use Visual Studio 2005 compiler (french version) with Code::Blocks.
I have a problem with accentuated words as you can see below:

A simple example with one error:
#include <stdio.h>
#include <stdlib.h>

int main()
{
a = 1;
printf("Hello world!\n");
return 0;
}


And the error message from the compiler:
Quote:: === Test, Debug ===
main.c:6: error C2065: 'a'ÿ: identificateur non d,clar,
:: === Build finished: 1 errors, 0 warnings ===

Is there a way to display accentuated characters with Code::Blocks or is it a problem with Visual Studio?

Thanks in advance and have a nice day.

Ceniza

You didn't add a type to the variable. It should be:

int a = 1;

It's funny to see VC says it's named 'a'ÿ. Is there anything special about that 'a'?

skirby

Hello Ceniza,

I know that my variable was not declared  :wink:
The aim was to make VS compiler display an error message in order to show you the problem with accentuated character like d,clar, instead of déclaré

skirby

I have post a bug report on BerliOS.
I hope this problem could be fix in a near futur  :)

Here is another example in order to make you understand the problem:
#include <iostream>

using namespace std;

int main()
{
int a;
a < 1;
cout << "Hello world!" << endl;
return 0;
}


With french compiler:
Quote:: === TestFrench, Debug ===
main.cpp:8: warning C4552: '<'ÿ: op,rateur sans effetÿ; op,rateur avec effet secondaire attendu
:: === Build finished: 0 errors, 1 warnings ===
In french, I should have had:
Quotemain.cpp:8: warning C4552: '<' : opérateur sans effet; opérateur avec effet secondaire attendu

with english compiler:
Quotemain.cpp:8: warning C4552: '<' : operator has no effect; expected operator with side-effect
:: === Build finished: 0 errors, 1 warnings ===

For information, I have reproduce this behavior with the build SVN 4185 (and many older version)
I also reproduced this on Windows 2000 sp4 and Windows XP sp2.

rickg22

I think this is a variant of the "accentuated characters in paths" bug.

skirby

I am not sure but I am not an expert.

But, don't you think that the problem could be due to the way C::B retrieve messages from compiler (problem with unicode string or something like that)

mykeys

It's because the standard console output encoding is cp437 (a.k.a IBM437), but the default encoding is windows-1252.
I would suggest to translate all accentuated characters when the user is using windows, knowing that the table is this:

I'm looking forward to solutions :)

JGM

Quote from: skirby on June 26, 2007, 11:23:57 PM
I am not sure but I am not an expert.

But, don't you think that the problem could be due to the way C::B retrieve messages from compiler (problem with unicode string or something like that)

I'm a spanish speaker and I have the same problem with accentuated letters like áéíóú. I resolved the problem on windows with the following argument for the compiler on gcc, -finput-charset=iso-8859-1. Maybe you have to specified to the compiler what file encoding is used.

For a reason I don't understand the utf-8 encoding is not working and is the default on gcc if i'm not wrong.