M
mimmo
Hi! I should convert the accented letters of a string in the correspondent
letters not accented. But when I compile with -Wall it give me:
warning: multi-character character constant
Do the problem is the charset? How I can avoid this warning? But the worst
thing isn't the warning, but that the program doesn't work! The program
execute all other operations well, but it don't print the converted
letters: for example, in the string "licia colò" (with finally o accented),
instead giving in stdout "licia colo" (without finally o accented), how
should be, print "licia col ", with two spaces.
The code is this:
<CODE>
93 switch(s) {
94 case 'Ã ':
95 t = 'a';
96 break;
97 case 'è': case 'é':
98 t = 'e';
99 break;
100 case 'ì':
101 t = 'i';
102 break;
103 case 'ò':
104 t = 'o';
105 break;
106 case 'ù':
107 t = 'u';
108 break;
109 default:
110 break;
111 }
</CODE>
Between the apexes there are the accented letters. I try also with sprintf(t
+ i, "a") instead of t = 'a', but it's the same thing. If instead of
accented letters I try to insert the unaccented letters, all works good.
The output of the gcc is this:
<OUTPUT>
[mimmo@localhost mimmo]$ gcc -Wall p.c -o p
p.c:94:38: warning: multi-character character constant
p.c:97:38: warning: multi-character character constant
p.c:97:49: warning: multi-character character constant
p.c:100:38: warning: multi-character character constant
p.c:103:38: warning: multi-character character constant
p.c:106:38: warning: multi-character character constant
[mimmo@localhost mimmo]$
</OUTPUT>
I hope anyone can give me an help, before than I drop the computer out
window!
letters not accented. But when I compile with -Wall it give me:
warning: multi-character character constant
Do the problem is the charset? How I can avoid this warning? But the worst
thing isn't the warning, but that the program doesn't work! The program
execute all other operations well, but it don't print the converted
letters: for example, in the string "licia colò" (with finally o accented),
instead giving in stdout "licia colo" (without finally o accented), how
should be, print "licia col ", with two spaces.
The code is this:
<CODE>
93 switch(s) {
94 case 'Ã ':
95 t = 'a';
96 break;
97 case 'è': case 'é':
98 t = 'e';
99 break;
100 case 'ì':
101 t = 'i';
102 break;
103 case 'ò':
104 t = 'o';
105 break;
106 case 'ù':
107 t = 'u';
108 break;
109 default:
110 break;
111 }
</CODE>
Between the apexes there are the accented letters. I try also with sprintf(t
+ i, "a") instead of t = 'a', but it's the same thing. If instead of
accented letters I try to insert the unaccented letters, all works good.
The output of the gcc is this:
<OUTPUT>
[mimmo@localhost mimmo]$ gcc -Wall p.c -o p
p.c:94:38: warning: multi-character character constant
p.c:97:38: warning: multi-character character constant
p.c:97:49: warning: multi-character character constant
p.c:100:38: warning: multi-character character constant
p.c:103:38: warning: multi-character character constant
p.c:106:38: warning: multi-character character constant
[mimmo@localhost mimmo]$
</OUTPUT>
I hope anyone can give me an help, before than I drop the computer out
window!