Ticket #19 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Add Unicode support

Reported by: anonymous Owned by:
Priority: major Milestone: 0.2
Version: 0.1 Keywords:
Cc:

Description

Support non-ASCII terminal input/output (such as UTF-8). This should not require any major changes to the existing architecture.

On Windows, we can use the wide-character versions of the input functions, like ReadConsoleInputW; and use WriteConsoleW for console output instead of putStr.

On POSIX, we'll probably use either the utf8-string or iconv libraries. That is, either always default to UTF8, or use iconv plus the current locale (from the nl_langinfo POSIX function, I suppose). The former is easier to implement, but the latter will be more portable.

Note also that in ghc 6.10, this all may be provided automatically; see http://www.haskell.org/pipermail/cvs-ghc/2008-June/043003.html

Finally, the functions in System.Directory are not (yet) Unicode-aware; the filename completion functions will need to be updated too.

Change History

Changed 6 years ago by anonymous

The lexer and keymaps will also need to be updated (accepting every character that satisfies Data.Char.isPrint).

Changed 6 years ago by judah

For now, we'll just support UTF-8.

TODO:

  • Win32 support
  • Make sure tab completion (printing choices, directory reading) works
  • Writing/reading the history file needs a fix
  • Make sure that this has not regressed Ctrl-C handling on 6.8.3.

Changed 6 years ago by judah

History file read/write is done, but only works properly with a patched version of utf8-string. I've sent the fix to the maintainers; once they post a new version of the library on Hackage I should bump up the version requirement in haskeline.cabal.

Changed 6 years ago by judah

  • Ctrl-C handling is verified to be working.
  • Tab completion printing choices works.
  • Directory listing is difficult since it's more tied to localization issues (rather than terminal I/O which can usually be set in preferences by the user). May not get to it until 0.3.

Changed 6 years ago by judah

Unicode I/O is now supported on Windows. Note that the console font must support the character, otherwise it will print boxes (but otherwise process it correctly).

Changed 6 years ago by judah

  • status changed from new to closed
  • resolution set to fixed

Done enough to claim support for Unicode cross-platform. See #20 and #22 for the remaining (punted) items.

Note: See TracTickets for help on using tickets.