1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

utf8bytelength: count UTF8 string bytelength

[Builtin name changed, and it only works on string inputs. -Nico]
This commit is contained in:
Joel Nothman
2015-09-08 12:51:42 +10:00
committed by Nicolas Williams
parent 63dd033da7
commit 83e8ec587f
3 changed files with 28 additions and 0 deletions

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: |