Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

UTF8 support in CoronaCards for WP8
Started by alexxwiz Nov 17 2016 06:16 AM

2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

alexxwiz

[GLOBAL: userInfoPane.html]
alexxwiz
  • Observer

  • 6 posts
  • Corona SDK

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!



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 20,856 posts
  • Corona Staff

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



[TOPIC: post.html]
#3

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.




[topic_controls]
[/topic_controls]