This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Umlauts on commandline and in .bat files


On Wed, Jul 18, 2001 at 12:49:02PM +0200, Ralf Fassel wrote:
> Consider this program, printing the commandline arguments char by char
> in octal:
> 
>     #include <stdio.h>
>     int
>     main(int argc, char *argv[])
>     {
> 	int i;
> 	unsigned char *p;
> 	for (i=1; i < argc; i++) {
> 	    p = argv[i];
> 	    while (*p) {
> 		printf("%03o ", *p++);
> 	    }
> 	    printf("\n");
> 	}
> 	return 0;
>     }
> 
> Now in a .bat file, I have a commandline containing german Umlauts:
>     $ cat ttt.bat
>     ./t.exe "ÄÖÜäöüß"
> 
> Running this via `sh' yields the expected result:
>     $ sh ttt.bat
>     304 326 334 344 366 374 337
> 
> But running via the `.bat => cmd' binding
>     $ ./ttt.bat
> 
>     h:\ralf\si++.4.0.C138>./t.exe "-Í_õ÷³¯"
>     055 315 137 365 367 263 257

CMD is running with OEM character set, Cygwin processes with ANSI.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]