* Spanish single characters recognized as multi-character
@ 2003-10-15 19:18 Salvador Ramirez
2003-10-15 20:37 ` Eljay Love-Jensen
0 siblings, 1 reply; 4+ messages in thread
From: Salvador Ramirez @ 2003-10-15 19:18 UTC (permalink / raw)
To: gcc-help
Hello,
I have a problem that I can reproduce with the following simple
example:
--------
#include <stdio.h>
int main(void) {
printf("%d - %c\n", 'ñ', 'ñ');
}
--------
if I compile that program I get the following message warning from GCC:
warning: multi-character character constant
for each time I use 'X' where X is either: á,é,Ã,ó,ú,ü or ñ, which are
spanish characters non-ascii. So it seems that gcc does not recognize
these characters as "single characters", but if so why? how could I
correct the program the program above?
I am using linux redhat 9.
Any help would be very appreciated,
---sram
Salvador RamÃrez Flandes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Spanish single characters recognized as multi-character
2003-10-15 19:18 Spanish single characters recognized as multi-character Salvador Ramirez
@ 2003-10-15 20:37 ` Eljay Love-Jensen
2003-10-15 20:49 ` Salvador Ramirez
0 siblings, 1 reply; 4+ messages in thread
From: Eljay Love-Jensen @ 2003-10-15 20:37 UTC (permalink / raw)
To: Salvador Ramirez, gcc-help
Hi Salvador,
What format is your text editor saving your files?
Try using one of the ISO 8859 flavors, instead of ISO 10646 (encoded in UTF8, I presume).
HTH,
--Eljay
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Spanish single characters recognized as multi-character
2003-10-15 20:37 ` Eljay Love-Jensen
@ 2003-10-15 20:49 ` Salvador Ramirez
0 siblings, 0 replies; 4+ messages in thread
From: Salvador Ramirez @ 2003-10-15 20:49 UTC (permalink / raw)
To: Eljay Love-Jensen; +Cc: gcc-help
Hello Eljay,
Eljay Love-Jensen wrote:
> Hi Salvador,
>
> What format is your text editor saving your files?
> Try using one of the ISO 8859 flavors, instead of ISO 10646 (encoded in UTF8, I presume).
You are right, redhat linux 9 uses by default UTF-8. I am using vi
editor and I suppose that it is enconding the literal characters I use
on the UTF-8 encoding.
Since a response I received from lrtaylor@micron.com I think I should
learn a little more about the C wide-char functions, I am on that.
Thanks Lyle and Eljay,
---sram
Salvador Ramirez Flandes
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Spanish single characters recognized as multi-character
@ 2003-10-15 19:35 lrtaylor
0 siblings, 0 replies; 4+ messages in thread
From: lrtaylor @ 2003-10-15 19:35 UTC (permalink / raw)
To: sram, gcc-help
What happens if you use wprintf instead?
wprintf(L"%d - %c\n", 'ñ', 'ñ');
Although, I don't recall for sure whether the L goes before or after the string constant...
Cheers,
Lyle
-----Original Message-----
From: Salvador Ramirez [mailto:sram@profc.udec.cl]
--------
#include <stdio.h>
int main(void) {
printf("%d - %c\n", 'ñ', 'ñ');
}
--------
if I compile that program I get the following message warning from GCC:
warning: multi-character character constant
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-15 20:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 19:18 Spanish single characters recognized as multi-character Salvador Ramirez
2003-10-15 20:37 ` Eljay Love-Jensen
2003-10-15 20:49 ` Salvador Ramirez
2003-10-15 19:35 lrtaylor
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).