utf8bytelength: count UTF8 string bytelength

[Builtin name changed, and it only works on string inputs. -Nico]
This commit is contained in:
Joel Nothman authored and Nicolas Williams committed 2015-09-13 01:01:24 -05:00
1 parent 63dd033da7
commit 83e8ec587f
3 files changed
+28

No files matched your search

+12
View File
@@ -662,6 +662,18 @@ sections:
input: '[[1,2], "string", {"a":2}, null]'
output: [2, 6, 1, 0]
- title: "`utf8bytelength`"
body: |
The builtin function `utf8bytelength` outputs the number of
bytes used to encode a string in UTF-8.
examples:
- program: 'utf8bytelength'
input: '"\u03bc"'
output: [2]
- title: "`keys`, `keys_unsorted`"
body: |