UTF8 support in CoronaCards for WP8

Can we some how get utf8 support in CoronaCards for WP8?

I know than CoronaCards does not support plugins, but utf8 is a base thing.

Maybe we can use it in some way? 

Please, give me any clues!

I don’t know how helpful this will be, but the source for the plugin is here:

https://github.com/coronalabs/luautf8

You probably could integrate it through Visual Studio. I’ll ask our engineering team if they have any advice.

Rob

You would have to implement this yourself in .NET, such as in C# or VB.NET.

We document how to communicate between Lua and .NET here…

   https://docs.coronalabs.com/daily/coronacards/wp8/communication.html

From there, you can use our “CoronaLabs.WinRT.Utf8String” helper class on the .NET side.  We publically document this class here…

   https://docs.coronalabs.com/daily/native/wp8/html/html/T_CoronaLabs_WinRT_Utf8String.htm

Note that .NET “String” objects are UTF-16 encoded.  When you pass a String in from Lua to .NET, Corona automatically transcodes that Lua string from UTF-8 to a .NET UTF-16 encoded String object.  When you pass a .NET String back to Lua, Coron automatically transcodes it from UTF-16 to a UTF-8 encoded Lua string.  So, you can use our “Utf8String” class linked above to create a UTF-8 encoded string from a .NET String (which is UTF-16).  From there, you can do the operations you need to perform with its methods.

I don’t know how helpful this will be, but the source for the plugin is here:

https://github.com/coronalabs/luautf8

You probably could integrate it through Visual Studio. I’ll ask our engineering team if they have any advice.

Rob

You would have to implement this yourself in .NET, such as in C# or VB.NET.

We document how to communicate between Lua and .NET here…

   https://docs.coronalabs.com/daily/coronacards/wp8/communication.html

From there, you can use our “CoronaLabs.WinRT.Utf8String” helper class on the .NET side.  We publically document this class here…

   https://docs.coronalabs.com/daily/native/wp8/html/html/T_CoronaLabs_WinRT_Utf8String.htm

Note that .NET “String” objects are UTF-16 encoded.  When you pass a String in from Lua to .NET, Corona automatically transcodes that Lua string from UTF-8 to a .NET UTF-16 encoded String object.  When you pass a .NET String back to Lua, Coron automatically transcodes it from UTF-16 to a UTF-8 encoded Lua string.  So, you can use our “Utf8String” class linked above to create a UTF-8 encoded string from a .NET String (which is UTF-16).  From there, you can do the operations you need to perform with its methods.