IOS Carriage Return Missing...

Strange one this.  I am pretty sure this is new behavior.

When I enter multi line text using an IOS device, upload the text and store it in a database any line feeds that are entered only have a ascii character 10.  The ascii character 13 (Carriage Return) is missing.

If the app is compiled for Windows the same screens do record two characters on a line feed - a Carriage Return (ascii 13) and a Line Feed (ascii 10).

This is only an issue when you then try and view any of the text that was entered in a different system.

Not sure what has happened…

platform differences!  store your data as a JSON object

iOS and macOS are based on a Unix variant of FreeBSD and the MACH kernel. Android is based on Linux, which itself is a Unix variant.

In Unix based OS’s and their derivatives, the line separator is a CTRL-J,  \n, ASCII 10.

The old OS 9 versions of Mac OS’s and earlier used a single CTRL-M, \r, ASCII 13 as the line separator.

Windows (and going back to it’s DOS days) has always used a two character sequence:  CTRL-M CTRL-J, \r\n, or ASCII 13 and 10.

It’s potentially best to break your lines on a \n character and then trim off any \r’s if they are there to handle the most cross-platform setup possible. You shouldn’t run into too many files that are only \r based.

As @SGS suggests, JSON is a good choice so you don’t need to do your own parsing on our end. 

Rob

Thanks guys. My problem is that the Corona App is compiled and used by people on IOS, Android, MAC and Windows. The data is stored in the cloud on a SQL database and the consumed (viewed) on any of the above platforms plus legacy systems - such as Microsoft Office apps. My work around was to put some code at the DB end. Any data submitted is intercepted and checked for character 13. If the submitted string has only characters 10 then character 13 is added. When viewing the altered text on IOS it looks the same, but is also corrected for the other platforms… Thanks for responding…

platform differences!  store your data as a JSON object

iOS and macOS are based on a Unix variant of FreeBSD and the MACH kernel. Android is based on Linux, which itself is a Unix variant.

In Unix based OS’s and their derivatives, the line separator is a CTRL-J,  \n, ASCII 10.

The old OS 9 versions of Mac OS’s and earlier used a single CTRL-M, \r, ASCII 13 as the line separator.

Windows (and going back to it’s DOS days) has always used a two character sequence:  CTRL-M CTRL-J, \r\n, or ASCII 13 and 10.

It’s potentially best to break your lines on a \n character and then trim off any \r’s if they are there to handle the most cross-platform setup possible. You shouldn’t run into too many files that are only \r based.

As @SGS suggests, JSON is a good choice so you don’t need to do your own parsing on our end. 

Rob

Thanks guys. My problem is that the Corona App is compiled and used by people on IOS, Android, MAC and Windows. The data is stored in the cloud on a SQL database and the consumed (viewed) on any of the above platforms plus legacy systems - such as Microsoft Office apps. My work around was to put some code at the DB end. Any data submitted is intercepted and checked for character 13. If the submitted string has only characters 10 then character 13 is added. When viewing the altered text on IOS it looks the same, but is also corrected for the other platforms… Thanks for responding…