Vely logo Empower C
install  tutorials  examples
documentation  license  about

12.1.0 released on Sep 19, 2022



Web(HTML)-encode string.


encode-web <string> to [ define ] <encoded string> \
    [ output-length [ define ] <encoded length> ] \
    [ input-length <length> ]


encode-web encodes <string> so it can be used in a HTML-like markup text (such as a web page or an XML/XHTML document), and stores the result in <encoded string> which may be created with optional "define". Optional "output-length" clause lets you get the length of the encoded string in <encoded length>, which can be created with optional "define". You can encode only the first <length> bytes, given by an "input-length" clause.


In this example, a string "str" will be web-encoded and the result is in "result" variable, with its length in "len_of_result" variable:
char str[]="  x<y>z&\"'  ";
encode-web str to define result output-length define len_of_result

The "result" is "   x&lt;y&gt;z&amp;&quot;&apos;  " and "len_of_result" is 33.


Web encoding ( decode-web   encode-web  )  SEE ALL (documentation)

Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Icons copyright PaweĊ‚ Kuna licensed under MIT. This web page is licensed under CC-BY-SA-4.0.