惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - Red_angelX

越狱iphone命令行ssh无法连接问题解决 Fedora22编译Qt3.3.X 黑科技项目:英雄无敌III Mod <<Fallen Angel>>介绍 中兴MF667S WCDMA猫Linux拨号笔记 NES模拟器开发-PPU笔记 Source Insight 3.X utf8支持插件更新 NES模拟器开发-CPU笔记 记录Qt的一个诡异Bug 准备开发一款开源NES模拟器 Source Insight 3.X 插件新loader发布 Source Insight 3.X utf8支持插件震撼发布 c语言非线程安全函数引发的BUG一列 Source Insight 3.X 标签插件v1.0发布 MinGW编译dll以及静态链接pthread 用Codeblocks的MinGW编译CxImage BMP图片魔法师KeyGen C#将Trace,Debug信息输出到控件上 五线谱编辑Demo(MFC) C#贴边自动隐藏组件完美版
让LuaInterface 2.0.1支持中文
Red_angelX · 2009-04-02 · via 博客园 - Red_angelX

     最近也心血来潮研究Lua在.net下的运用,已有不少牛人在这方面做出了贡献,其中可以选择的封装库有LuaNet和LuaInterface,不过这2个库都有着不支持Unicode字符(汉字)的问题-_-#..

     luanet下载地址:http://luaforge.net/projects/luanet/,最新版本Version 0.01

     luainterface下载地址:http://luaforge.net/projects/luainterface/,最新版本为Version 2.0.3

     对比人气感觉luainterface略高一些,版本更新多,并且还有不少工具,而luanet就显得有点单薄了.

     关于luanet的中文支持,博客园有这么一篇文章:<<Lua 在.net 中的是非>>,然而可能是luaforge上的库版本有更新,调试的时候并不是在luaxlib.cpp的getS函数出错,而是在一个NetToC_Str函数里由于汉字的wchar>255直接返回NULL无法翻译了.

     luainterface2.0.3暂时未放出源码,2.0.1算个稳定版吧,下载回来,根据<<Lua 在.net 中的是非>>一文的思路,推测中文问题仍然是字符串的长度造成的,于是写个测试代码跟踪调试一下:

Code

     DoString下断点,F5,断下,F11,看到代码:

Code

     因该就是这里的luaL_loadbuffer出错了,在F11,到了luaxlib.c,看到代码:

Code

     果然,也是一个ls.size=size的赋值,看看IDE提示的size的值,79,这不正是错误的原因么,

修改代码如下:

Code

     重新编译,运行,中文出来了^_^.可以慢慢享受lua和.net带来的快感了