Mike_D
(Mike D)
August 22, 2021, 10:22pm
1
Related to the discussion here: https://forum.xojo.com/t/jsonitem-encoding-issue-in-2021-releases it seems as if Session.URLParameter() gives a string with a nil encoding. Shouldn’t it default to UTF8?
Edit to add: or maybe URLs are actually ASCII as per What character set should I assume the encoded characters in a URL to be in? - Stack Overflow
In either case, the answer “nil” seems to be the wrong encoding…
1 Like
Mike_D
(Mike D)
August 22, 2021, 11:48pm
2
<https://xojo.com/issue/65621 >
WebSession has some inconsistent Encodings:
WebSession.URLParameter() has nil Encoding
WebSession.URL has UTF8 encoding (should this actually be ASCII?)
WebSession.HashTag has ASCII encoding
1 Like
Mike_D
(Mike D)
August 23, 2021, 2:17pm
3
Further testing reveals that the encoding is nil when the parameter exists, but not if the parameter is missing.
DerkJ
(DerkJ)
August 23, 2021, 3:30pm
4
This encoding mess… xojo should, could well define and convert (if nil) default to UTF-8 even on the EncodeHex function it returns nil encoding, so put it on a jsonfile wil fail… better returned a UTF8 encoded hex string than… etc.
For web it would be nice if there was a content type charset given it could use that othwise default (if text-based) to utf8…
Mike_D
(Mike D)
August 23, 2021, 4:15pm
5
Agree - and since ASCII is always a valid subset of UTF8, I think defaulting to UTF8 would cause no harm.
1 Like