4

如何在 SML 中打印小写希腊epsilon(使用 Poly/ML)?

我尝试了以下方法:

print "ε"; (* Error-unprintable character found in file *)
print "\u03B5"; (* Error-Conversion exception (Invalid string constant) raised while converting \u03B5 to string *)

这根本不可能吗?当然,实际渲染字符是终端的工作,因此应该可以将原始字符代码打印到标准输出?

4

1 回答 1

3

Unicode 转义序列\u03B5对应于 UTF-16。

您的终端可能运行 UTF-8,其中 ε 为 0xCE 0xB5。将它们作为十进制字节输入:

> print "\206\181\n";
ε
于 2015-08-11T08:52:00.570 回答