Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
16e2b484
"tests/vscode:/vscode.git/clone" did not exist on "abf0afa9125b8f2d7e471b8465d0fa6b9e59dbf5"
Unverified
Commit
16e2b484
authored
Feb 20, 2019
by
Vinicius Jarina
Committed by
GitHub
Feb 20, 2019
Browse files
Added UTF8 docs
parent
2571453e
Changes
1
Show whitespace changes
Inline
Side-by-side
README.md
View file @
16e2b484
...
@@ -62,6 +62,26 @@ You can use/instantiate any .NET class without any previous registration or anno
...
@@ -62,6 +62,26 @@ You can use/instantiate any .NET class without any previous registration or anno
```
```
*
Using UTF-8 Encoding:
NLua runs on top of
[
KeraLua
](
https://github.com/NLua/KeraLua
)
binding, it encodes the string using the ASCII encoding by default.
If you want to use UTF-8 encoding, just set the
`Lua.State.Encoding`
property to
`Encoding.UTF8`
:
```
csharp
using
(
Lua
lua
=
new
Lua
())
{
lua
.
State
.
Encoding
=
Encoding
.
UTF8
;
lua
.
DoString
(
"res = 'Файл'"
);
string
res
=
(
string
)
lua
[
"res"
];
Assert
.
AreEqual
(
"Файл"
,
res
);
}
```
Creating Lua state:
Creating Lua state:
```
csharp
```
csharp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment