Polyjuice Util v0.1.0 Polyjuice.Util View Source
Link to this section Summary
Functions
Escape a user ID localpart so that it only uses the allowable character set.
Link to this section Functions
Escape a user ID localpart so that it only uses the allowable character set.
The method used is defined in https://matrix.org/docs/spec/appendices#mapping-from-other-character-sets
By default, it will escape upper-case letters. If you want upper-case
letters to simply be lower-cased, use the fold_case: true
option.
Examples:
iex> Polyjuice.Util.escapelocalpart("abc\x01 !\",-./09:;<=>?@AZ[\]^az{|}~á") "abc=01=20=21=22=2c-./09=3a=3b=3c=3d=3e=3f=40_a_z=5b=5c=5d=5e__=60az=7b=7c=7d=7e=c3=a1" iex> Polyjuice.Util.escape_localpart("abc\x01 !\",-./09:;<=>?@AZ[\\]^_
az{|}~á", foldcase: true)
"abc=01=20=21=22=2c-./09=3a=3b=3c=3d=3e=3f=40az=5b=5c=5d=5e=60az=7b=7c=7d=7e=c3=a1"