Re: Question on Unicode characters reading and printing

From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 09/13/05


Date: Tue, 13 Sep 2005 13:06:22 +0200


"SAM" <mshyamrao@gmail.com> writes:
>> So you're using the LC_CTYPE environment variable value. What is it?
>> Are you sure it's an UTF-8 variation? Why don't you set explicitely
>> the locate to an UTF-8 locale or use a UTF-8 conversion routine?
>>
> I have set LANG=de_DE.UTF-8 and ran setlocale(LC_CTYPE,"");
>
>> > w_example=(wchar_t *) malloc(100);
>> > mbstowcs(w_example,example,MB_CUR_MAX);
>
> Conversion to wide character string is happening. How should I print
> those characters. I cant seem to print it on my console when I set
> LANG=ru_RU.UTF-8.

Well, of course, if you want to print on a UTF-8 terminal, you must
convert back TO utf-8, not to utf-32. So why didn't you keep the
utf-8 bytes? Do you need to do string processing on these data?

> I know this is language setting issue. How can I
> know different language support on SCO Unixware or indeed is it
> supported on SCO Unixware. How to configure console for various
> languagees. I am using xterm.
> I tried xterm -u8 but no luck not working.

Yes, you must locate a utf-8 enabled terminal, and if an X terminal
emulator, you'll need to have internationnal X fonts installed.

mlterm is a multi-lingual X terminal emulator that is able to work
with utf-8. http://mlterm.sourceforge.net/

Also, you can work in emacs, and configure the utf-8 encodings in
emacs to be able to display the unicode characters. You'll need X
international fonts or emacs intlfonts too.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
This is a signature virus.  Add me to your signature and help me to live


Relevant Pages

  • =?utf-8?B?UmU6IFN0cmluZyAiw6LigqzihKIiIHRyYW5zbGF0ZWQgdG8gYXBvc3Ryb3BoZS4gV2h5Pw==?=
    ... it works), though it seems to use mostly just Ascii characters, representing ... but the author is not making the best possible use of UTF-8. ... They don't map it to ASCII apostrophe, ... Latin 1 encoding. ...
    (alt.html)
  • [PATCH] UTF-8 input: composing non-latin1 characters, and copy-paste
    ... One can put the keyboard driver into Unicode mode, load a Unicode keymap, and get single keystrokes generate valid UTF-8 for non-ASCII characters. ...
    (Linux-Kernel)
  • Re: Special Characters in Query String
    ... I've had numerous problems with utf-8, ... in common characters in spanish not geting displayed. ... > available for encoding of characters. ... > If you can display your characters with ISO-8859-1, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Enhanced Unicode support for "Go" tools
    ... maybe Rene and Randy to note, perhaps - is an "ASCII compatible" ... version of UNICODE...in fact, for strict 7-bit ASCII, UTF-8 and ... characters so, being on Windows, that opinion makes great sense ... where the majority of the supported languages ...
    (alt.lang.asm)
  • RichEdit EM_STREAMIN CP_UTF8 nulls out some input characters
    ... When I read a file encoded as UTF-8 into a RichEdit control, ... some of the characters from the input file are being replaced with nulls. ... LRESULT APIENTRY MainProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ... WCHAR* fnp; ...
    (microsoft.public.win32.programmer.ui)