Skip to content

Commit 4a55893

Browse files
committed
Support for non-latin characters.
1 parent be07d7b commit 4a55893

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

MDX2JSON/Installer.cls.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,18 @@ Download list of files on https://raw.githubusercontent.com/ server.<br>
307307
For i = 1:1:Links.Count() {
308308
Set streq = Request.Get($e(Links.GetAt(i),35,*)) // Remove "https://raw.githubusercontent.com/" from URL.
309309
Set:$$$ISERR(streq) st=$$$ADDSC(st, streq)
310-
Set stload = $system.OBJ.LoadStream(Request.HttpResponse.Data,"",.error,.items)
311-
Set:$$$ISERR(stload) st=$$$ADDSC(st, stload)
312-
Merge Items = items
310+
Set binarystream = Request.HttpResponse.Data
311+
Do binarystream.Rewind() // just in case
312+
313+
Set stream=##class(%GlobalCharacterStream).%New() //translating binary stream into character stream
314+
While 'binarystream.AtEnd {
315+
Do stream.Write(binarystream.Read())
316+
}
317+
Do stream.Rewind()
318+
319+
Set stload = $system.OBJ.LoadStream(stream,"",.error,.items,,,,"UTF8")
320+
Set:$$$ISERR(stload) st=$$$ADDSC(st, stload)
321+
Merge Items = items // Does not overwrite existing array keys: Items(itemname)=""
313322
}
314323
315324
Set Request.Server="api.github.com"

0 commit comments

Comments
 (0)