longname to api encoding.
Merge branch 'encode-longname'