[Haskell-cafe] Can we improve Show instance for non-ascii charcters?
Travis Cardwell
travis.cardwell at extellisys.com
Sat Feb 6 02:08:41 UTC 2016
On 02/06/2016 12:58 AM, Michael Orlitzky wrote:
> But for the terminal? Try Ctrl-Alt-F1 to drop out of X and into a
> Linux/BSD terminal, and runghc on a file containing,
>
> main = mapM_ putStrLn $ [(++"の父"), (++"の母")] <*> ["田中", "山田"]
>
> I get a bunch of grey question marks.
By default, Ctrl+Alt+F1 takes you to a "virtual console," which uses a
framebuffer with very limited memory. Console fonts are limited to 256
glyphs, or 512 glyphs with fewer colors, which is too few glyphs for a
proper CJK Unicode font. (**tangent below**)
This issue applies to all Unicode software; it is not specific to Haskell.
Cheers,
Travis
**tangent**
It is possible to use Unicode outside of X with other software. For
example, fbterm is a terminal emulator that selects fonts with fontconfig
and renders them using freetype2, making the usual X fonts available for
use. Here are some (Japanese) instructions for installation:
Debian8 コンソールで日本語利用(fbterm)
http://qiita.com/mtomoaki_96kg/items/e5a946fd38f7318d3758
More information about the Haskell-Cafe
mailing list