lib: move encodeStr function to internal for reusable
The encodeStr function and qsEscape function are almost the same.
Extract encodeStr function and move it to internal for reusable.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
cc @mscdex