"tests/vscode:/vscode.git/clone" did not exist on "abf0afa9125b8f2d7e471b8465d0fa6b9e59dbf5"
Unverified Commit 16e2b484 authored by Vinicius Jarina's avatar Vinicius Jarina Committed by GitHub
Browse files

Added UTF8 docs

parent 2571453e
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment