Skip to content

Commit 93fc362

Browse files
committed
Support for non-latin characters.
1 parent ffde8a2 commit 93fc362

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

CacheUpdater/Task.cls.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<Property name="GitHubURL">
1212
<Description>
1313
Repository URL, like https://github.com/intersystems-ru/Cache-MDX2JSON
14-
Encreased to 250 to support long urls</Description>
14+
Increased to 500 to support long urls</Description>
1515
<Type>%String</Type>
16-
<Parameter name="MAXLEN" value="250"/>
16+
<Parameter name="MAXLEN" value="500"/>
1717
</Property>
1818

1919
<Property name="Username">
@@ -166,7 +166,18 @@ Download list of files on https://raw.githubusercontent.com/ server.<br>
166166
For i = 1:1:Links.Count() {
167167
Set streq = Request.Get($e(Links.GetAt(i),35,*)) // Remove "https://raw.githubusercontent.com/" from URL.
168168
Set:$$$ISERR(streq) st=$$$ADDSC(st, streq)
169-
Set stload = $system.OBJ.LoadStream(Request.HttpResponse.Data,"",.error,.items)
169+
170+
Set binarystream = Request.HttpResponse.Data
171+
Do binarystream.Rewind() // just in case
172+
173+
Set stream=##class(%GlobalCharacterStream).%New() //translating binary stream into character stream
174+
While 'binarystream.AtEnd {
175+
Do stream.Write(binarystream.Read())
176+
}
177+
Do stream.Rewind()
178+
179+
Set stload = $system.OBJ.LoadStream(stream,"",.error,.items,,,,"UTF8")
180+
170181
Set:$$$ISERR(stload) st=$$$ADDSC(st, stload)
171182
Merge Items = items // Does not overwrite existing array keys: Items(itemname)=""
172183
}

0 commit comments

Comments
 (0)