From owner-freebsd-hackers Tue Mar 28 17:37: 2 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from happy.checkpoint.com (kinata.checkpoint.com [199.203.156.41]) by hub.freebsd.org (Postfix) with ESMTP id CD16637B61D for ; Tue, 28 Mar 2000 17:36:54 -0800 (PST) (envelope-from mellon@pobox.com) Received: (from mellon@localhost) by happy.checkpoint.com (8.9.3/8.9.3) id DAA14975; Wed, 29 Mar 2000 03:39:08 GMT (envelope-from mellon@pobox.com) Date: Wed, 29 Mar 2000 03:39:08 +0000 From: Anatoly Vorobey To: Christian Weisgerber Cc: hackers@freebsd.org Subject: Re: Unicode on FreeBSD Message-ID: <20000329033908.A14122@happy.checkpoint.com> References: <20000320194702.11223.qmail@web3101.mail.yahoo.com> <8bitar$2i4f$1@bigeye.rhein-neckar.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <8bitar$2i4f$1@bigeye.rhein-neckar.de>; from naddy@mips.rhein-neckar.de on Sat, Mar 25, 2000 at 06:34:19PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Mar 25, 2000 at 06:34:19PM +0100, Christian Weisgerber wrote: > MikeM wrote: > > > Has anyone thought of Unicode support on FreeBSD? > > It has crossed my mind... > > > I think that it is inevitable that eventually FreeBSD > > will *need* to support unicode if it wants to continue > > as a viable operating system in the future. > > Probably. The demand for Unicode support is currently rather limited, > but I expect it to pick up somewhat once it is pervasive under > Linux and applications programmers come to expect its availability. I wonder how useful it would be to teach syscons/kbd to handle Unicode. If I mess up royally in the details below, someone please correct me, I only browsed through the sources a bit. Currently, if I understand this correctly, the keyboard driver, and not the console driver, is aware of the current keymap. The keymap maps keycodes with modifiers to actions, which are either some misc actions or character codes. The console driver gets character codes from kbd driver and doesn't need to know anything about keymaps (?). It doesn't know about screen fonts either; it just throws charcodes to video driver which has current font installed. It converses with applications via charcodes as well; at that level, the charcodes also include terminal emulation sequences. The unhappy drawbacks are: a) different language encodings require separate keymap files even when the actual keyboard layout doesn't change. b) different language encodings require separate screen fonts because those are indexed by character codes. c) general 8-bit limitations. d) ...? Now suppose we change the keymap files to assign Unicode codes to keycodes with mofifiers. (the actual Unicode numbers seem better in this case than short UTF-8 sequences?). The kbd driver returns those to syscons. Syscons now has the notion of the current encoding table which translates 8-bit <--> Unicode. It translates the codes back to 8-bit and gives them to applications. When applications give output, syscons translates it back into Unicode after handling the terminal emulation stuff. The video driver now uses a font which only depends on screen size, but not on encoding. It displays the stuff. If this works, the next step would be to offer UTF-8 as the ultimate table and start teaching usermode apps to be happy with it. However, even before that, the immediate effect would be great simplification and reduction of keymaps/screen fonts structure. Does this sound reasonable? -- Anatoly Vorobey, mellon@pobox.com http://pobox.com/~mellon/ "Angels can fly because they take themselves lightly" - G.K.Chesterton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message