在 Poly/ML 中打印 Unicode 字符
Printing Unicode Characters in Poly/ML
如何在 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 *)
这根本不可能吗?确实渲染字符是终端的工作,因此应该可以将原始字符代码打印到标准输出?
Unicode 转义序列 \u03B5
对应于 UTF-16。
您的终端可能运行 UTF-8,其中 ε 是 0xCE 0xB5。将它们作为十进制字节输入:
> print "61\n";
ε
如何在 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 *)
这根本不可能吗?确实渲染字符是终端的工作,因此应该可以将原始字符代码打印到标准输出?
Unicode 转义序列 \u03B5
对应于 UTF-16。
您的终端可能运行 UTF-8,其中 ε 是 0xCE 0xB5。将它们作为十进制字节输入:
> print "61\n";
ε