santook Member Dec 31, 2016 #1 Does Arduino support UTF8 character encoding and decoding operations on b4r ide?
Erel B4X founder Staff member Licensed User Longtime User Jan 1, 2017 #2 Strings in B4R (and in Arduino) are mostly identical to arrays of bytes. There are no encoders or decoders. This is different than other B4X tools where strings represent a set of characters. You can use UTF8 strings in the IDE. For example: Code: Copy Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") Dim s As String = "שלום" Log(s) Log(s.Length) End Sub Output: AppStart שלום 8 The length is 8 because the 4 characters were converted to 8 bytes during compilation. Upvote 0
Strings in B4R (and in Arduino) are mostly identical to arrays of bytes. There are no encoders or decoders. This is different than other B4X tools where strings represent a set of characters. You can use UTF8 strings in the IDE. For example: Code: Copy Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") Dim s As String = "שלום" Log(s) Log(s.Length) End Sub Output: AppStart שלום 8 The length is 8 because the 4 characters were converted to 8 bytes during compilation.