🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3878

EUC<->Unicode (Curses woes on Solaris)

#3878
From: Howard Kapustein
Date: Tue, 18 Dec 2001 19:55
31 lines
2071 bytes
We're using curses on Solaris 8.
Which appears to support EUC only.

int euc = wgetwch() gets a character of input and addwch(c) displays a
character.

I need the data as Unicode.
Specifically, UCS-2.
[UCS-4 also works.]
I'd even settle for UTF-8 (I've got UTF conversion routines).

How do I reliably transform EUC<->Unicode?

Locale settings don't help.
Looks like Sun (others?) encode EUC from the keyboard as a 4-byte
value where c & 0x30000000 == code set (see csetno() definition in
Sun's header).

Only problem is, they don't say what code set 0, 1, 2 or 3 really is.
Looks like CS1 == JIS-X-0208
Yes?
What about the rest?

And that's fine for input.
For output, I've got a Unicode character like 0x30A1 (lower case
katakana a) -- how do I make that a valid EUC character curses will
recognize?

Help!

    - Howard
Technical Details
Message-ID: <59bfe011.0112181155.77a73800@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,4ecdeed075c19330,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fc89c,4ecdeed075c19330,start
X-Google-Attributes: gidfc89c,public
X-Google-Thread: f6653,4ecdeed075c19330,start
X-Google-Attributes: gidf6653,public
X-Google-Thread: 10204d,4ecdeed075c19330,start
X-Google-Attributes: gid10204d,public
X-Google-Thread: fb9a0,4ecdeed075c19330,start
X-Google-Attributes: gidfb9a0,public
X-Google-ArrivalTime: 2001-12-18 11:55:49 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: hsk0@kapustein.com (Howard Kapustein)
Newsgroups: comp.unix.programmer,comp.sys.sun.misc,comp.unix.questions,japan.comp.sun,comp.software.international
Subject: EUC<->Unicode (Curses woes on Solaris)
Date: 18 Dec 2001 11:55:48 -0800
Organization: http://groups.google.com/
Lines: 31
Message-ID: <59bfe011.0112181155.77a73800@posting.google.com>
NNTP-Posting-Host: 12.29.89.35
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1008705349 10374 127.0.0.1 (18 Dec 2001 19:55:49 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 18 Dec 2001 19:55:49 GMT