Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

WENCODEJSON

The WENCODEJSON subroutine will encode a string to properly be in a JSON value.

COMMAND SYNTAX

CALL WENCODEJSON(OPTION,INSTR,OUTSTR)

SYNTAX ELEMENTS

ParameterDescription
OPTIONLeave blank.  Placeholder for future features
INSTRThe string you wish to encode
OUTSTRThe encoded string.

EXAMPLE

CALL WENCODEJSON("",'"',OUTSTR)
* OUTSTR = \u0022   (Encoding for ")

NOTES

The WENCODEJSON function is primarily used internally by the other subroutines (such as WBUILDJSON AND WOBJ).  You can although call it yourself if you are doing your own string building.

Was this article helpful?