Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Terminal UTF-8 output via ncursesw

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  getting live slider info  
Author Message
Christoph

External


Since: Jun 14, 2006
Posts: 1



(Msg. 1) Posted: Wed Jun 14, 2006 8:39 am
Post subject: Terminal UTF-8 output via ncursesw
Archived from groups: comp>sys>mac>programmer>misc (more info?)

Hi all,

I'm having problems getting UTF-8 output from ncurses on the Mac OS X
Terminal. Vim (using "set encoding=utf-8") and direct output to the
terminal work, so I guess the terminal is up correctly (I've set LC_ALL
to en_US.UTF-Cool. I've compiled my own ncurses so that I can be sure
it's been compiled with the --enable-widec option.

Currently I'm trying around with the following snippet (in which
<c3><84> represent the associated hex codes):

#include <ncursesw/ncurses.h>
int main(int argc, char *argv[])
{
initscr();
addstr("<c3><84>");
refresh();
getch();
endwin();
return 0;
}

Simply outputting the raw .c text file to the terminal via "cat" gives
the correct output in the "addstr" line: an A-umlaut "Ä". Compiling it
via

gcc -I $MY_NCURSES_DIR/include utf8test.c -L$MY_NCURSES_DIR/lib
-lncursesw

works without any error, but running the resulting code only results in
a "?~D" output (two charachters, without the quotes). As far as I've
understood the ncurses-docs, UTF-8 output is supposed to work using the
normal output routines, and the special wide routines like "addwstr"
are only required for wchar_t types.

I guess I'm doing something very simple wrong here, but I just have no
idea what. Maybe someone's got an idea?

Thanks in advance,
Christoph.

 >> Stay informed about: Terminal UTF-8 output via ncursesw 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
terminal-usb-commands - Are there any OS 10.3-terminal-commands for the usb? In O'Reilly's Essential System-Admin. you find on page 807 under "usb devices" only FreeBSD, Linux and Solaris USB Support, no hints for the Apple Unix under 10.3. Where can I find these comm...

Determining the terminal's encoding - I'd like to programmatically determine the encoding of the current Terminal.app. What kind of API do I need to use? TIA, Martin

[Q] "Terminal" application slow when called from Carbon apps - I run (or try to) LaTeX from whitin Emacs. I have experienced, generally, that when Carbon apps call "Terminal" apps, the "TerminaL" app runs extremely slow. when called from Terminal (which is a Carbon app, to add to confusion), La...

Binding usual cursor movement key-sequences in Terminal.app - Hi! When I use terminal environment (Terminal.app) on Mac OS X in configuring or other development, I miss the "ordinary" cursor movement keys such as ctrl+arrow keys etc. According to Man page for bash(1), the default bindings for cursor mov...

modify OS X keyboard mappings - Hello, I need to have access to the french characters. I can do this with the Canadian - CSA keyboard. However, that keyboard has a "," as a decimal. I need a ".". Changing it in the international control panel does not change...
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]