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
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
Hide 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
```
*
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:
```
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