utf8.strpad()

Like std.strpad() except count gives the number of unicode code points for the output string rather than bytes.

Errors

This function requires the input strings s and pad to be UTF-8 encoded. If they are not, fastly.error will be set to EUTF8.

Format

STRING
utf8.strpad(STRING s, INTEGER count, STRING pad)

Examples

1
2
utf8.strpad("abc", 7, "🌸🌼"); # gives "🌸🌼🌸🌼abc", seven code points total
std.strpad("abc", 7, "🌸🌼"); # gives "🌸abc" because 🌸 is four bytes