Skip to content

Commit 286f48a

Browse files
committed
Always convert result to UTF8
Fixed #19
1 parent 2cf27bc commit 286f48a

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

isc/py/Callout.cls

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ ClassMethod GetRandomSimple() As %Double
7272
/// w ##class(isc.py.Callout).SimpleStringFull()
7373
ClassMethod SimpleStringFull(code = {"import random;" _ $$$NL _ "x=random.random();"}) As %Double
7474
{
75-
set converted = $$$NO
76-
if $ZISWIDE(code) {
77-
set code = $zcvt(code, "O", "UTF8")
78-
set converted = $$$YES
79-
}
75+
set:$ZISWIDE(code) code = $zcvt(code, "O", "UTF8")
76+
8077
set result = $ZF(-6, ..#PyLibId, ..#SimpleStringFull, code)
81-
set:converted result = $zcvt(result, "I", "UTF8")
78+
set result = $zcvt(result, "I", "UTF8")
8279
quit result
8380
}
8481

@@ -89,14 +86,10 @@ ClassMethod SimpleStringFull(code = {"import random;" _ $$$NL _ "x=random.random
8986
/// write ##class(isc.py.Callout).SimpleString()
9087
ClassMethod SimpleString(code As %String = "", variable As %String = "", serialization As %Integer = 0) As %String
9188
{
92-
set converted = $$$NO
93-
if $ZISWIDE(code) {
94-
set code = $zcvt(code, "O", "UTF8")
95-
set converted = $$$YES
96-
}
89+
set:$ZISWIDE(code) code = $zcvt(code, "O", "UTF8")
9790
set result = $ZF(-6, ..#PyLibId, ..#SimpleString, code, variable, serialization)
9891

99-
set:converted result = $zcvt(result, "I", "UTF8")
92+
set result = $zcvt(result, "I", "UTF8")
10093
quit result
10194
}
10295

0 commit comments

Comments
 (0)