How can I convert a utf-8 string to uppercase in a Redhat Enterprise 4 server? All cgis are written in C.
utf-8 to uppercase in Redhat Linux
Collapse
X
-
Tags: None
-
i never did it, but the thing is if it has mixed up both single byte and multibyte character in the same string, then all you have to do
is skip the next sequential characters
here is the code
Code:for(i=0;i<stringlenth;) { if(c1>=224) { i=i+3; } else if(c1>=192) { i=i+2; } else { if(string[i]>='a' && string[i]<='z') { string[i]=string[i]-('a'-'A');//I forgot the difference; } i=i+1; } }
Comment