InterSystems FAQ rubric
You can avoid the error by specifying a stream object as the argument of %ToJSON() used when generating a JSON string from a dynamic object.
A code example is below.
USER>set temp=##class(%Stream.TmpCharacter).%New()
USER>set jsonobj={}
USER>set jsonobj.pro1=["a","b","c","d"]
USER>set jsonobj.pro2=["あ","い","う","え"]
USER>do jsonobj.%ToJSON(temp)
USER>write temp.Size
51
USER>write temp.Read()
{"pro1":["a","b","c","d"],"pro2":["あ","い","う","え"]}See also the documentation for details.

.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)