haskell:输出非ASCII字符 [英] haskell: output non-ascii characters

查看:110
本文介绍了haskell:输出非ASCII字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  Prelude>我想在WinGHCi中输出非ascii字符,但这是我得到的:

δ
\ 948
前奏> putStr\948
***异常:< stdout> ;: hPutChar:无效的参数(字符不在代码页中)

我在Windows XP上使用WinGHCi 7.0.3。
我该怎么做才能让WinGHCi打印出一个漂亮的小三角?

p>

  Prelude> putStrLn\948
δ

听起来像这是一个windows问题,用haskell做...


I'd like to output non-ascii characters in WinGHCi, but this is what I get:

Prelude> "δ"
"\948"
Prelude> putStr "\948"
*** Exception: <stdout>: hPutChar: invalid argument (character is not in the code page)

I am using WinGHCi 7.0.3 on windows xp. What do I have to do so that WinGHCi prints a nice little delta?

解决方案

Works on OSX!

Prelude> putStrLn "\948"
δ

Sounds like this is a windows problem with nothing to do with haskell...

这篇关于haskell:输出非ASCII字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆