Hi, Elvis,

Assuming your strings were in UTF-8 (I didn't have a chance to
see the original due to mangling of the strings by the email system),
your program will perform perfectly on a recent Linux distribution
(such as SuSE or Redhat which now default to UTF-8 locales for most
geographic locales)
when using a truly Unicode-capable terminal such as mlterm.  I should
note that mlterm will even work correctly on a system such as OpenBSD
which somehow completely lacks internationalization and UTF-8 locales.

So, why are you giving yourself a headache with some environment on
Windows?  It makes no sense.  My suggestion: Do whatever you want to
do/learn on Linux first because Linux provides everything you need for
learning and using Unicode/UTF-8.  Then, after you *know* that your
program works flawlessly on Linux, then you can try to sort out why
it doesn't work on Windows.  It's a process of elimination that will
work.  If you start out trying to do even a simple program like this
on windows, there are too many unknown problems that you won't be able
to pin down.  With Cygwin being a layer on top of Windows, it is harder
to figure out whether the problems are due to Cygwin, Windows, or both!

For Unicode on Linux, have you seen my page,
http://eyegene.ophthy.med.umich.edu/unicode/ ?
This is actually a little bit out of date (I plan to revise it soon),
 but still it will tell
you even how to get mlterm to work properly for UTF-8 on a system like
OpenBSD where there are no UTF-8 locales.  I myself have never yet gotten
proper display of UTF-8 on a Windows DOS console or Cygwin terminal. On
the other hand, I've had no trouble with UTF-8 on Linux, OpenBSD, FreeBSD,
Mac OS X, and Solaris.  So why not just forget about Windows?

In conclusion, I have to completely disagree with your conclusion
at the end of your email.  Unicode works very well currently on many platforms,
(even Windows, but perhaps not flawlessly on the Windows DOS console which
Windows engineers have "neglected" (if that is the right word) for ages anyway).
So you don't have to wait 100 years.  And in 100 years not everyone will speak
English. 


On Wednesday 2004.06.30 10:41:27 -0700, Elvis Presley wrote:
> To: the Unicode experts at linux-utf8:
> 
> Salut!
> 
> When in doubt as to where to begin, always start at the begining.
> 
> My first program:
> 
> ================================
> #include <stdio.h>
> 
> int main(int argc, char *argv[])
> {
>   printf("Hello World!\n");
>   printf("&#922;&#945;&#955;&#951;&#956;&#941;&#961;&#945;
> &#922;&#972;&#963;&#956;&#949;!\n");
>   printf("Bonjour ? Tous!\n");
>   return 0;
> }
> ================================
> 
> This should work, because the literal in printf() is a multi-byte character
> string.
> 
> But it didn't.
> 
> I have two scenarios, neither is Linux.
> 
> 1) A gcc based RDE called "Dev-4 C++" for Windows 98. The editor in this
> program will not let me enter Greek letters, neither in 8859-7, nor utf-8. On
> Copy & Paste, it seems to convert everything to 8859-1, so I can write a really
> nice 'hello' program in Latin-1.  
> 
> 2) gcc running in the cygwin emulator. I can't seem to make vim do anything
> reasonable, so I create the utf-8 file in Windows using Word 2000 (or UniPad),
> and copy it over to /cygwin, where I can compile and run it. I recognise the
> "Hello World!" string output, but I haven't been able to determine the exact
> nature of the other strings.
> 
> My question is this:
> 
> I assume the compiler uses the locale to determine the character set to use for
> the string literals.
> 
> Might I be able to set the locale in cygwin to 'something-utf8'?
> 
> Regards,
> 
> Elvis
> 
> PS
> 
> Wouldn't it be nice if all computers were utf-8 by default, but I know, legacy
> issues... I don't think this Unicode thing will ever work, well, maybe in a
> hundred years. But by then, the world will be speaking English.
> 
> 
> 
>               
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail 
> 
> --
> Linux-UTF8:   i18n of Linux on all levels
> Archive:      http://mail.nl.linux.org/linux-utf8/
> 

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to