Available in all subroutines.
count gives the
number of Unicode code points for the output string rather than bytes.
This function requires the input strings
pad to be UTF-8 encoded.
If they are not,
fastly.error will be set
utf8.strpad("abc", 7, "🌸🌼"); # gives "🌸🌼🌸🌼abc", seven code points totalstd.strpad("abc", 7, "🌸🌼"); # gives "🌸abc" because 🌸 is four bytes
User contributed notes
We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.