Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/yencode?V=12
QUERY_STRINGV=12
CONTENT_TYPE
DOCUMENT_URI/revision/yencode
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.126.45
REMOTE_PORT59084
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR18.217.8.82
HTTP_CF_RAY87dfa0a67f2be104-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP18.217.8.82
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit yencode {'''yencode''' is part of [tcllib]



** See Also **

   [uudecode]:   
   
   [base64]:   related functionality (other encoders)



** Documentation **

   [http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/base64/yencode.html%|%official reference]:   





** Description **

This package provides a Tcl-only implementation of the yEnc file encoding. This
is a recently introduced method of encoding binary files for transmission
through Usenet. This encoding packs binary data into a format that requires an
8-bit clean transmission layer but that escapes characters special to the
[NNTP] posting protocols. See http://www.yenc.org/ for details concerning the
algorithm.

----

[Pat Thoyts] wrote in [comp.lang.tcl]:

I found out about yenc encoding ... and it's not the same as uuencoding.
Hopefully you are not trying to decode yenc data using the
[uuencode]/[uudecode] code :) If you want a tcl yenc decoder I'm going to add
one to [tcllib]'s [base64] module shortly.

[LV] and in fact Pat has added (to the latest base64 module of tcllib) a
yencode set of functions.

In the meantime here is the core of this method:

======
namespace eval yencode {} ;# added by RS 

proc yencode::yEncode {s} {
    set r {}
    binary scan $s c* d
    foreach {c} $d {
        set v [expr {($c + 42) % 256}]
        if {$v == 0x00 || $v == 0x09 || $v == 0x0A 
            || $v == 0x0D || $v == 0x3D} {
            append r "="
            set v [expr {($v + 42) % 256}]
        }
        append r [format %c $v]
    }
    return $r
}

proc yencode::yDecode {s} {
    set r {}
    set esc 0
    binary scan $s c* d
    foreach c $d {
        if {$c == 61 && $esc == 0} {
            set esc 1
            continue
        }
        set v [expr {($c - 42) % 256}]
        if {$esc} {
            set v [expr {($v - 42) % 256}]
            set esc 0
        }
        append r [format %c $v]
    }
    return $r
}
======

----

Someone recently posted a question on [comp.lang.tcl] asking about yenc
multi-part support in Tcl. Anyone know of such code?

----

I don't know of any support in tcl; but there is C-code available at
http://www.fpx.de/fp/Software/UUDeview/.  It has a tcl interface layer.  I
wasn't able to get that working myself (did not try very hard) but the
standalone application definitely converts multipart yenc files.

----

There is a bug in the example encode/decode code above that also exists in the
tcllib implementation.  The yEnc 1.3 spec states that escaped characters should
have their ascii value further rotated by 64, not 42, so the escape character
rotation value should be by 64, not 42 as in the example code.  This bug exists
in the current CVS v. 1.11 copy of the base64/yencode.tcl tcllib file.

I discovered this while trying to decode some externally yencoded data with
tcllib's yencode.tcl implementation.  I was getting corrupt output from
ydecode.  Making this change to my yencode.tcl file produces correctly decoded
output data from ::yencode::decode.

I would have posted to the sourceforge tracker, except that logins to
sourceforge are disabled at the moment.

[AK] 2003-12-10 09:40:  Just tried to login and had no trouble.

[AK]: RE, can you please provide me with an example text which triggers the bug
? A patch showing exactly what to change would be good as well.

[AK] Ok, should be fixed in Tcllib CVS Head now, yencode 1.1.2.

======

<<categories>> Category Package | [Tcllib] | [Arts and crafts of Tcl-Tk programming]} regexp2} CALL {my render yencode {'''yencode''' is part of [tcllib]



** See Also **

   [uudecode]:   
   
   [base64]:   related functionality (other encoders)



** Documentation **

   [http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/base64/yencode.html%|%official reference]:   





** Description **

This package provides a Tcl-only implementation of the yEnc file encoding. This
is a recently introduced method of encoding binary files for transmission
through Usenet. This encoding packs binary data into a format that requires an
8-bit clean transmission layer but that escapes characters special to the
[NNTP] posting protocols. See http://www.yenc.org/ for details concerning the
algorithm.

----

[Pat Thoyts] wrote in [comp.lang.tcl]:

I found out about yenc encoding ... and it's not the same as uuencoding.
Hopefully you are not trying to decode yenc data using the
[uuencode]/[uudecode] code :) If you want a tcl yenc decoder I'm going to add
one to [tcllib]'s [base64] module shortly.

[LV] and in fact Pat has added (to the latest base64 module of tcllib) a
yencode set of functions.

In the meantime here is the core of this method:

======
namespace eval yencode {} ;# added by RS 

proc yencode::yEncode {s} {
    set r {}
    binary scan $s c* d
    foreach {c} $d {
        set v [expr {($c + 42) % 256}]
        if {$v == 0x00 || $v == 0x09 || $v == 0x0A 
            || $v == 0x0D || $v == 0x3D} {
            append r "="
            set v [expr {($v + 42) % 256}]
        }
        append r [format %c $v]
    }
    return $r
}

proc yencode::yDecode {s} {
    set r {}
    set esc 0
    binary scan $s c* d
    foreach c $d {
        if {$c == 61 && $esc == 0} {
            set esc 1
            continue
        }
        set v [expr {($c - 42) % 256}]
        if {$esc} {
            set v [expr {($v - 42) % 256}]
            set esc 0
        }
        append r [format %c $v]
    }
    return $r
}
======

----

Someone recently posted a question on [comp.lang.tcl] asking about yenc
multi-part support in Tcl. Anyone know of such code?

----

I don't know of any support in tcl; but there is C-code available at
http://www.fpx.de/fp/Software/UUDeview/.  It has a tcl interface layer.  I
wasn't able to get that working myself (did not try very hard) but the
standalone application definitely converts multipart yenc files.

----

There is a bug in the example encode/decode code above that also exists in the
tcllib implementation.  The yEnc 1.3 spec states that escaped characters should
have their ascii value further rotated by 64, not 42, so the escape character
rotation value should be by 64, not 42 as in the example code.  This bug exists
in the current CVS v. 1.11 copy of the base64/yencode.tcl tcllib file.

I discovered this while trying to decode some externally yencoded data with
tcllib's yencode.tcl implementation.  I was getting corrupt output from
ydecode.  Making this change to my yencode.tcl file produces correctly decoded
output data from ::yencode::decode.

I would have posted to the sourceforge tracker, except that logins to
sourceforge are disabled at the moment.

[AK] 2003-12-10 09:40:  Just tried to login and had no trouble.

[AK]: RE, can you please provide me with an example text which triggers the bug
? A patch showing exactly what to change would be good as well.

[AK] Ok, should be fixed in Tcllib CVS Head now, yencode 1.1.2.

======

<<categories>> Category Package | [Tcllib] | [Arts and crafts of Tcl-Tk programming]}} CALL {my revision yencode} CALL {::oo::Obj4768405 process revision/yencode} CALL {::oo::Obj4768403 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4