Encode XML special characters by using simple C code
special characters | entities |
---|---|
& | & |
' | ' |
" | " |
< | < |
> | > |
git clone https://github.com/melody26613/xml-encode-by-C.git
cd xml-encode-by-C/
make clean; make
./sample "&'\"<>"
result
input str: &'"<>
encode: &'"<>
decode: &'"<>
./sample "&&&''\"<>>><"
result
input str: &&&''"<>>><
encode: &&&''"<>>><
decode: &&&''"<>>><
./sample "&&&\"<'>>><"
result:
input str: &&&"<'>>><
encode: &amp;&amp;&"<&apos;>>><
decode: &&&"<'>>><
please reference code under test/ and test/README.md