[fpc-pascal] Resourcestrings in FPC 3.0

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Sep 24 10:22:51 CEST 2015


On 2015-09-24 09:09, Martin Schreiber wrote:
> It is an advantage to have pure ASCII files for such data.


Escaped text seems optional, but the UTF-8 encoding seem recommended.
Using non-escaped Unicode text is faster to parse and easier to read [by
a human] - and from my understanding of the RFC specs, less error prone.

See also the important point about escaped text and UTF-16.

β€œJSON documents can be encoded in UTF-8, UTF-16 or UTF-32, the default
encoding being UTF-8.[14] These encodings support the full Unicode
character set, including those characters outside the Basic Multilingual
Plane (U+10000 to U+10FFFF). However, if escaped those characters must
be written using UTF-16 surrogate pairs, a detail missed by some JSON
parsers. For example, to include the Emoji character U+1F602 πŸ˜‚ face
with tears of joy in JSON:

{ "face": "πŸ˜‚" }
// or
{ "face": "\uD83D\uDE02" }
”
  --- [https://en.wikipedia.org/wiki/JSON#Data_portability_issues]


Reference also Section 8.1 from RFC7159:
  https://tools.ietf.org/html/rfc7159#section-8.1


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list