Class DC.BigJSON Extends %RegisteredObject
{

ClassMethod Test(filename)
{
	if ..SaveToFile(..MakeJSON(), filename) {
		write "Save OK",!
		write "Size ",##class(%File).GetFileSize(filename),!
		
		set input=##class(%File).%New(filename)
		set sts=input.Open("RS")
		if sts {
			set json={}.%FromJSON(input)
			set iter=json.%GetIterator()
			while iter.%GetNext(.key, .val) {
				write "key=",key," size=",$l(val)," data=",$e(val,1,10)_"...",!
			}
		} else  { write $system.Status.GetOneErrorText(sts),! }
	}
}

ClassMethod MakeJSON()
{
	set obj={}
	set obj.text1=$tr($j("",3600000)," ","a")
	set obj.text2=$tr($j("",3600000)," ","b")
	set obj.text3=$tr($j("",3600000)," ","c")
	quit obj
}

ClassMethod SaveToFile(obj, filename)
{
	set file=##class(%File).%New(filename)
	set sts=file.Open("wnu")
	if sts {
		do obj.%ToJSON(file)
		do file.Rewind()
		use file.Name 
		do file.OutputToDevice()
		do file.Close()
		quit 1
	} else { quit sts }
}

}

The size shouldn't be a problem


USER>do ##class(DC.BigJSON).Test("/tmp/test1.txt")
Save OK
Size 10800034
key=text1 size=3600000 data=aaaaaaaaaa...
key=text2 size=3600000 data=bbbbbbbbbb...
key=text3 size=3600000 data=cccccccccc...

The first part (Base 64 encoding is not able to encode ... unicode (2 byte) characters)  is correct. The second part (data-->utf8-->base64 and base64-->utf8-->data) is correct only if there is an agreement beetwen the sender and receiver about the double-encoding (utf8+base64).

If I was told, I get a base64 encoded file then I expect a file which is only base64 encoded and not a mix of several encodings including base64. A simple way to encode your document could be something like this:

ClassMethod Encode(infile, outfile)
{
    // file-binary reads bytes and not characters
    set str = ##class(%Stream.FileBinary).%New()
    set str.Filename = infile
    set len = 24000 // len #3 must be 0 !
    set nonl = 1    // no-newline: do not insert CR+LF
    do str.Rewind()

    open outfile:"nwu":0
    if $test {
        use outfile
        while 'str.AtEnd { write $system.Encryption.Base64Encode(str.Read(len),nonl) }
        close outfile
    }
    quit $test
}

In the past we got challenges with a better definition... ;-((  ☹


In the original post, I'm pretty sure, there were
")s)).:D :~) ;~D :) xD ))" instead of
")s).:D :~) ;~D :) xD"

and
"(smiley) ))" instead of
"(smiley)"

Nevertheless,

"Sadness >:( :[ :{ :("  ---> you say: 0
         >                     I say: 1 (0 Eyses, 0 noses 1 mouth)
and there is no rule about interspace requirements

My quick solution:

ClassMethod Count(s)
{
	while $locate(s,"[:;8B=]?[co\^~-]?[\)\]\}D>]",$g(i),i),$i(n){} q +$g(n)
}

/// If one accepts "" as 0 then change +$g(n) to $g(n)

/// I would like a solution as (see the + char in regex)
/// but then the rules should be changed
///
ClassMethod Count(s)
{
	while $locate(s,"[:;8B=]?[co\^~-]?[\)\]\}D>]+",$g(i),i),$i(n){} q +$g(n)
}

According to your definition, "A number is Esthetic if ... between every pair of its adjacent digits ...", the test example

test.assert_equals(esthetic(1), [2, 3, 4, 5, 6, 7, 8, 9, 10])

is wrong, because the number one (1) converted in whatever number base is always 1. Looking on that 1 I do NOT see any ADJACENT digit(s), except you define that a single digit is always an esthetic number (but I do not see such a definition).

justmy2cents

If your system does not support JSON (i.e. pre 2016.2?) then give this "dirty trick" a try:

- add a zero-width-space character to your numbers
- create the output stream
- remove the zero-width-space characters

Instead of the zero-width-space you can use any other character too, which does not appear in your data (binary data should be base64 encoded).

ClassMethod WithQuotes()
{
	set zwsp = $c(8203) // zero-width-space
	set obj = ##class(%ZEN.proxyObject).%New()
	
	set obj.ID = 1234_zwsp
	set obj.Number=123.45_zwsp
	
	if ##class(%ZEN.Auxiliary.jsonArrayProvider).%WriteJSONStreamFromObject(.tmp,obj) {
  		set json=##class(%Stream.TmpBinary).%New()
		do tmp.Rewind()
		while 'tmp.AtEnd { do json.Write($tr(tmp.Read(32000),zwsp)) }
	}
	
	do json.Rewind()
	write json.Read(json.Size)
}

The one way is to use %XML.TextReader

ClassMethod Reader(str, pth, ByRef val)
{
	kill val
	set val=0
	// Adjust the method name below to your needs
	// ParseString(), ParseStream(), ParseFile() 
	if ##class(%XML.TextReader).ParseString(str,.rdr) {
		while rdr.Read() {
			if rdr.NodeType="chars",rdr.Path=pth set val($i(val))=rdr.Value
		}
		quit 1
	}
	quit 0
}

set str="<?xml version=""1.0"" encoding=""UTF-8""?><Input><data><Ids><Id><Type>A</Type><Value>123</Value></Id><Id><Type>B</Type><Value>456</Value></Id></Ids></data></Input>"
write ##class(yourClass).Reader(str,"/Input/data/Ids/Id/Value",.val) --> 1
zw val -->
val=2
val(1)=123
val(2)=456

The other way is to use %XML.Reader() and correlate to a class which describes your XML structure

As you wrote,  %XML.TextReader is used to read arbtrary XML documents. "A text where in the middle a little bit xml-structure sits" isn't XML!

Maybe there is a Pyhton library for extracting XML from a text. If not, probably you have to read char-after-char, count each "<" (+1) and ">" (-1) and if the counter is 0 then between the first "<"  and the last ">" probably you have a correct XML structure. Oh, and don't forget for <![CDATA[...]]> sequences, which makes the reading more challenging.

Your subject (compilation error iris terminal class not found) and the screenshot
- workinhg on Class: Class TESTsAMTraining.NewClassDemo1
- calling a class: do ##class(MyCos.COSTest).Main
- and the error message: <CLASS DOES NOT EXISTS>

do not match!

I do not see anything about a "compilation error" on the other hand, there is an error saying, a class do not exists.

So please help us to help you and try to give us correct data about your problem.
Thank you.

Just came to my mind
- Cache-5.0.x is likely to be 32 Bit version, Win-11 is 64 Bit (only) (in case, the application uses some .dll, .ocx, etc.)
- unlikely that you use it, but as a hint, LAT is not supported anymore
- user database is now provided by ISC. In case your application maintains its own users, you can still use your own user database, but the login process will require some "adaption"

As a first step, I would contact your ISC Sales because Cache-5.0.x licenses neither work with (the latest) Cache nor with IRIS. Second, there was a lot of change between Cache-5.0.x and recent Cache/IRIS versions, so I would check to see if there are any problems to expect. A customer of mine "upgraded" fom Cache-5.0.21 to IRIS  some four years ago...

Just for the case, you are lost in the working memory space and desperately searching the spot(s) in your programm where a specific object is once again referenced, here a small handy method which could help you

/// find all variables which contain a given object(reference)
/// 
/// I: the OREF you looking for
/// 
/// O: "" if the spool-device can't be opened
///    [] if no variables contain the given OREF
///    [var1, var2, ... varN] an array of variable names (incl. subscripted and orefs)
///    
ClassMethod FindObject(obj)
{
	set res=[]
	if $d(%)#10,%=obj do res.%Push("%")
	new % set %=obj kill obj
	
	lock +^SPOOL("nextID")			// adapt this lines
	open 2:($o(^SPOOL(""),-1)+1):1	// to your method of
	lock -^SPOOL("nextID")			// creating new spool IDs
	
	if $t {
		use 2
		set spl=$zb
		do $system.OBJ.ShowReferences(.%,1)
		
		for i=1:1:$za-1 {
			set x=$p($zstrip(^SPOOL(spl,i),"<=>w",$c(13,10))," ",3)
			do:x]"%.~" res.%Push(x)
		}
		close 2
		kill ^SPOOL(spl)
		
	} else { set res="" }
	
	quit res
}

Example

USER>kill
USER>set pers=##class(DC.Person).%OpenId(1)
USER>set temp=pers, zz(3)=temp
USER>write ##class(DC.Help).FindObject(pers).%ToJSON()
["pers","temp","zz(3)"]