Right now, $codepage(N) is returning same as $codepage(0) for all negative N. Suggest that -1 returns info about the current codepage, so that $codepage(-1).name could return the name of the current codepage. Without that, it's needed to do something like:

//var -s %codepage $server(-1).encoding | if (%codepage) { var %n $codepage(0) | while (%n) { if ($codepage(%n).id == %codepage) { var %codepage %n | break } | dec %n } | echo -a $server(-1).encoding is the $ord(%n) codepage: $codepage(%n).desc : $codepage(%n).name

The missing end-brace is intentional, as this is how I stumbled across the new nested bug


Ok i see this is pointless, because /help and versions.txt were misleading.

Because in addition to $codepage(N), it already does treat $codepage($codepage(N)).prop the same as $codepage(N).prop

//echo 4 -a $codepage($server(-1).encoding).name
does show the name of the encoding for the current connection

At least I found a nested bug out of this

so: this can be moved to the missing documentation thread

Last edited by maroon; 15/08/22 01:45 PM.