Acknowledged

String.toCharArray() crashes if the string contains Swedish characters

A user reported a crash in my data field, and I eventually narrowed it down to a line of code that was calling toCharArray() on a user-provided string.  In this case, the string was "Östra Hällsjön".

A single umlauted character is enough to cause toCharArray() to crash.  For example:

var testStr = "Ö";
var chars   = testStr.toCharArray();

In the simulator, the debug console shows:

Error: System Error
Details: Failed invoking <symbol>
Stack: 
  - compute() at C:\dev
{filename}.mc:178 0x10000d9c 

The line number is the line with the call to toCharArray().  I have not done extensive testing to see what other characters may cause it to crash.

SDK:  6.2.2

Devices:  Epix2 51mm, Fenix 6X, Edge 1000

Parents
  • I'll add that the 6.2.2 simulator does not display the Swedish characters properly.  But they seem to display okay on the actual device.

    Also, other String functions (like substring) seem to work fine.  toCharArray() is the only one I have found so far that crashes.

Comment
  • I'll add that the 6.2.2 simulator does not display the Swedish characters properly.  But they seem to display okay on the actual device.

    Also, other String functions (like substring) seem to work fine.  toCharArray() is the only one I have found so far that crashes.

Children
No Data