bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Remedial question re wide chars


From: Mike Gran
Subject: Remedial question re wide chars
Date: Sat, 29 Sep 2007 11:23:25 -0700 (PDT)

Hi-

I'm having trouble getting started with add_wch.  I want to put
Cyrillic character on the stdscr using add_wch.

I wrote a test program (attached) to print a non-ASCII char to the
screen.  (GNU/Linux, wide-enabled ncurses-5.6, xterm 224) But I can't
figure out a combination of env LANG and LC_*, fonts, and xterm options
that will make the non-Latin character appear.  I know that the font
contains the Cyrillic glyphs.

My best guess was 
LANG=en_US.utf8
XTerm*font: -misc-fixed- ... -iso10646-1

Any hints?  

-Mike 

#define _XOPEN_SOURCE_EXTENDED
#include <curses.h>
#include <unistd.h>

int main()
{
  int ret;
  cchar_t wcval;

  /* U+041B CYRILLIC CAPITAL LETTER EL*/
  wchar_t cyrillic_el[2] = {0x041B, 0x0}; 
  /* U+0041 LATIN CAPITAL LETTER A */
  wchar_t latin_a[2] = {0x0041, 0x0};

  initscr();

  ret = setcchar(&wcval, cyrillic_el, A_NORMAL, 0, NULL);
  if (ret == OK)
      mvadd_wch (0, 0, &wcval);

  ret = setcchar(&wcval, latin_a, A_NORMAL, 0, NULL);
  if (ret == OK)
      mvadd_wch (2, 0, &wcval);

  refresh ();
  sleep (5);
  endwin ();

  return 0;
}
 







reply via email to

[Prev in Thread] Current Thread [Next in Thread]