Encode a string into the "JSON Pointer" RFC 6901 format.
It replaces ~
with ~0
and /
with ~1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=*), | intent(in) | :: | str |
pure function encode_rfc6901(str) result(str_out)
implicit none
character(kind=CK,len=*),intent(in) :: str
character(kind=CK,len=:),allocatable :: str_out
str_out = str
call replace_string(str_out,tilde,tilde//CK_'0')
call replace_string(str_out,slash,tilde//CK_'1')
end function encode_rfc6901