aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/json_functions_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-03-12 20:54:19 +0300
committerZyX <kp-pav@yandex.ru>2016-04-18 02:48:20 +0300
commit4f8b6864350c3aac5427103e27c856d1782b1be1 (patch)
treeb2d62156d146f9e8c6b5f145d7980c077bd1a2a9 /test/functional/eval/json_functions_spec.lua
parentc129f6cfafc77d3f6e22b2ac11b5c8f2cec033d3 (diff)
downloadrneovim-4f8b6864350c3aac5427103e27c856d1782b1be1.tar.gz
rneovim-4f8b6864350c3aac5427103e27c856d1782b1be1.tar.bz2
rneovim-4f8b6864350c3aac5427103e27c856d1782b1be1.zip
documentation,functests: State that UTF-8-only support is intentional
Diffstat (limited to 'test/functional/eval/json_functions_spec.lua')
-rw-r--r--test/functional/eval/json_functions_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/eval/json_functions_spec.lua b/test/functional/eval/json_functions_spec.lua
index 8483152dbf..bed9d668fa 100644
--- a/test/functional/eval/json_functions_spec.lua
+++ b/test/functional/eval/json_functions_spec.lua
@@ -521,6 +521,14 @@ describe('json_decode() function', function()
local str = ('%s{%s"key"%s:%s[%s"val"%s,%s"val2"%s]%s,%s"key2"%s:%s1%s}%s'):gsub('%%s', s)
eq({key={'val', 'val2'}, key2=1}, funcs.json_decode(str))
end)
+
+ it('always treats input as UTF-8', function()
+ -- When &encoding is latin1 string "«" is U+00C2 U+00AB U+00C2: «Â. So if
+ -- '"«"' was parsed as latin1 json_decode would return three characters, and
+ -- only one U+00AB when this string is parsed as latin1.
+ restart('set encoding=latin1')
+ eq(('%c'):format(0xAB), funcs.json_decode('"«"'))
+ end)
end)
describe('json_encode() function', function()