On Fri, 24 Apr 2009, Alexander S.Kresin wrote:

Hi,

>   for a few years I use for Harbour Linux console applications the gtcrs, 
> but last time more and more new distributions goes with UTF8 coding and 
> gtcrs doesn't show national characters ( possibly, ncursesw should be used 
> instead of ncurses, but this is other issue ).

In the past I created GTCRW but I haven't committed it due to ncursesw
limitations for which I have to create a lot of workarounds. With current
GT model it can be implemented much easier but I do not know if it's worth
to invest time for it. See below.

>   Which gt can I use now with distributions, based on UTF8, to see national 
> characters properly ?

1. GTTRM it's terminal GT which does not use curses or slang and does not
   use termcap/terminfo database. It supports only few most popular terminals
   XTERM/LINUX/ANSI.
   It automatically detects UTF8/ISO terminal mode and works well with both.
   It also should work well as simple GTSTD as long as you do not use some
   full screen command but will operate only on console output.
   Probably GTTRM is the best as default choice until you do not have to
   use some exotic terminals or some seldom used *nix ports.

2. GTSLN with slang 1.4.x + Unicode patches or with slang2 which has native
   support for UTF8. GTSLN supports both slang versions.

>   I've tried gtxwc, but, most likely, I've missed something, and cyrillic 
> characters was showed incorrectly, too. SO the second question is - what I 
> need to set ( codepage, font, something other ... ) to see cyrillic letters 
> properly with gtxwc ?

You have to inform GT driver about codepage you are using in your source
GT output so it can make conversion to unicode values. See HB_SETTERMCP()

   2006-02-04 17:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
   [...]
         The new three .prg functions:
            HB_SETKEYCP( <cTermCP> [,<cHostCP>] )
            HB_SETDISPCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
            HB_SETTERMCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
         have been added. They set automatic input (HB_SETKEYCP)
         and output (HB_SETDISPCP) (or both: HB_SETTERMCP) character
         translation. They are also important for some GTs which
         informing them about used internal code page for unicode
         translation (GTXWC, GTSLN) and/or chosing proper character
         set (standard/alternate) for letters and other (f.e. box
         drawing characters) (GTCRS, GTSLN),
            <cTermCP> is encoding used on external (terminal) side
            <cHostCP> is encoding used internally, if not given then
                      current code page set HB_SETCODEPAGE() is used.
                      some of GTs which uses unicode output may
                      ignore <cTermCP>
            <lBoxChar> is optional parameter which interacts with dispbox()
                       output disabling switching to alternate character
                       set in some GTs. It effectively causes that if internal
                       (host) code page contains some letters on the box char
                       positions then they will be shown also by box drawing
                       functions like dispbox() instead of CP437 characters.
                       In some cases it could be useful. By default lBoxChar
                       is not set and GTs which can switch between standard
                       and alternate character set (GTCRS, GTSLN) will try to
                       use alternate character set for box drawing functions.

To the above list of GTs you should add GTTRM (added later) and Unicde builds
of some windows only GTs like GTWVT.
Probably in your case it will be enough to make sth like:
   HB_SETTERMCP( "RUISO", "RUISO" )

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to