[疑难] 关于DMDScript的文字编码问题
smjk
2007-09-18
本人是菜鸟,偶尔看到D语言,立即被吸引住了,但到今天却发现这个问题
我下载了Dmdscript 脚本源码 和 Dmdscript 的可执行文件,但发现用源码编译出来的ds.exe 解释脚本时候不支持 汉字,会报错,用UTF-8保存后的脚本文件也报错. 但是用下载的可执行版本却不存在这个问题,我猜可能是C++编译的. 但DMDScript语言应该不会不支持Unicode的脚本吧,这到底是怎么回事? 现在就是这个疑问.有没有人. |
|
player7
2007-09-18
好像很少有人用dmdscript
|
|
smjk
2007-09-19
我觉得D语言编译器也有这个问题 ,我把Hello.d(示例中的) 添加一句 printf("你好");结果打印出来的是 "浣犲ソ" 我倒....
|
|
player7
2007-09-19
这是个老问题了,原因是输出的utf8格式,而控制台显示不了;
请查找以前的老帖子; 有三种方法: 1:转成 asc输出 2:改变控制台的显示格式 3:直接使用Tango库 |
|
achun
2007-09-19
试试这个Walnut
http://dsource.org/projects/walnut |
|
smjk
2007-09-19
引自 Digitalmars.com changelog:
# Bugzilla 961: std.windows.registry stack corruption # Bugzilla 1315: CTFE doesn't default initialise arrays of structs # Bugzilla 1342: struct const not accepted as initializer for another struct # Bugzilla 1363: Compile-time issue with structs in 'for' # Bugzilla 1375: CTFE fails for null arrays # Bugzilla 1378: A function call in an array literal causes compiler to crash # Bugzilla 1384: Compiler segfaults when using struct variable like a function with no opCall member. # Bugzilla 1388: multiple static constructors allowed in module # Bugzilla 1414: compiler crashes with CTFE and structs # Bugzilla 1421: Stack Overflow when using __traits(allMembers...) # Bugzilla 1423: Registry: corrupted value # Bugzilla 1436: std.date.getLocalTZA() returns wrong values when in DST under Windows # Bugzilla 1446: Missing comma in Final Const and Invariant page title # Bugzilla 1447: CTFE does not work for static member functions of a class # Bugzilla 1448: UTF-8 output to console is seriously broken # Bugzilla 1450: Registry: invalid UTF-8 sequence # Bugzilla 1460: Compiler crash on valid code # Bugzilla 1464: "static" foreach breaks CTFE # Bugzilla 1468: A bug about stack overflow. 关于UTF8在控制台输出,好像这些更新已经貌似解决了! 还有,只是控制台不行吗,我用MessageBox API 函数也不行,但是用DFL就可以 另外> Tango 库是什么,好像Java也有是吗? |
|
smjk
2007-09-19
achun 写道 试试这个Walnut
http://dsource.org/projects/walnut 我找不到下载的连接呀,你可以告诉我哪里下载吗? |
|
achun
2007-09-19
svn http://svn.dsource.org/projects/walnut
也可以直接浏览器浏览 |
|
smjk
2007-09-19
Not Found
The requested URL /projects/walnu was not found on this server. Apache Server at svn.dsource.org Port 80 |
|
puppy
2007-09-21
确实是这样 官方编译的dmd 1.02就可以处理中文,而自己编辑的1.13就不行
|