简体   繁体   English

将“中文”字符串传递给NLua

[英]Passing 'chinese' string to NLua

I have C# code calling a lua function. 我有C#代码调用lua函数。 I'm passing string to this function. 我正在将字符串传递给此函数。 This function processes the string and returns another string in a table. 此函数处理字符串,并在表中返回另一个字符串。

When I try to pass 'chinese' string "怎么说" - I get "???" 当我尝试传递“中文”字符串“称为”时,我得到“ ???” in lua. 在lua。 (I tried to print and save this string to file). (我尝试打印此字符串并将其保存到文件)。 My C# encoding is correct as I can see the correct chinese characters in visual studio debugging session. 我的C#编码是正确的,因为在Visual Studio调试会话中可以看到正确的中文字符。 How do I pass the 'chinese' string to lua? 如何将“中文”字符串传递给lua?

Appreciate any help. 感谢任何帮助。

This was a issue in NLua. 这是NLua中的问题。

Was already fixed: https://github.com/NLua/NLua/issues/48 已经修复: https : //github.com/NLua/NLua/issues/48

i am use NLua 1.4.25 still get "???" 我正在使用NLua 1.4.25仍会收到“ ???”

lua like this: "return \\"中文\\"" 像这样的lua:“返回\\“中文\\”“

last i Use NeoLua Replace NLua 最后我用NeoLua代替NLua

https://github.com/neolithos/neolua/ https://github.com/neolithos/neolua/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM