Unicode, the clipboard and LC fields
fraser.gordon at runrev.com
Wed Jan 22 12:37:51 EST 2014
On 22 Jan 2014, at 17:23, Richard Gaskin <ambassador at fourthworld.com> wrote:
> Why UTF-16 rather than UTF-8?
Windows, OSX and iOS use UTF-16 in their native APIs. Android is (I believe) UTF-8. Linux is usually UTF-8 but could technically be anything…
There are valid reasons for either choice but in the end it shouldn't really matter to anyone who isn't fiddling with the engine source code - it's probably best thinking of the use of UTF-16 as an implementation detail. Any time you do I/O to a file or socket, you should say what encoding you want or else you'll end up with a lossy native encoding.
As an example, I could imagine lcVCS choosing to export scripts as UTF-8 because those are easiest to work with using git and other VCS tools. Just because the engine uses UTF-16 in memory doesn't mean that anything else has to use the same encoding.
More information about the Use-livecode