It’s hard to blame the FreePascal team for that, given that Linux is primarily utf-8, and that utf-8 has quite a few advantages over utf-16.
utf-16 is an historical quirk
DWScript’s String type is currently utf-16, in Windows and in Smart, but I’m wondering whether to allow them to be utf-8 instead on some targets (for FreePascal & Linux). DWScript doesn’t have a distinct utf-16 character type, characters in DWScript are either Unicode code-points (utf-32) or small strings (to accommodate Chinese characters). While this would “fork” the language, the effects would be restricted to code that
- iterates over a string by character indexes, and checks for non-ASCII characters
- slices non-ASCII characters/strings at fixed offsets
- depends on lengths of strings that have non-ASCII characters
All those cases are probably quite low-level. The rest of the code would remain utf-8/utf-16 agnostic.
So what do you think?
DWScript utf-8 and/or utf-16 Strings?
- Stick to utf-16 everywhere (lower performance in Linux) (29%, 36 Votes)
- Fork the language (use what's best on each platform) (56%, 71 Votes)
- I have no idea what this all means (15%, 19 Votes)
Total Voters: 126
Delphi mobile compilers
Note that I am aware that the new Delphi mobile compilers dropped UTF8String support (leading to ugly marshalling and performance issues), but the new Delphi mobile compilers have priced themselves out of the market as far as I’m concerned, and the reliance on FMX is either problematic or an extra cost.
So non-HTML5 mobile support for DWScript is more likely to come through FreePascal than Delphi at the moment.