Index: lib/app-wikit/start.tcl =================================================================== RCS file: /home/cvs/wikit/lib/app-wikit/start.tcl,v retrieving revision 1.35 diff -u -w -r1.35 start.tcl --- lib/app-wikit/start.tcl 2003/05/01 13:45:35 1.35 +++ lib/app-wikit/start.tcl 2003/05/28 18:27:22 @@ -101,6 +101,9 @@ # this is essential to avoid hanging on a "Moz 0.9.9 > 8 Kb edit" bug if {[info exists ::env(SCRIPT_NAME)]} { + fconfigure stdout -encoding utf-8 + fconfigure stdin -encoding utf-8 + encoding system utf-8 package require cgi cgi_input } @@ -154,6 +157,7 @@ } Wikit::ProcessCGI } elseif { $wikit_httpd ne "" } { + encoding system utf-8 package require cgi package require Web package require wikithttpd Index: lib/httpd/wikithttpd.tcl =================================================================== RCS file: /home/cvs/wikit/lib/httpd/wikithttpd.tcl,v retrieving revision 1.2 diff -u -w -r1.2 wikithttpd.tcl --- lib/httpd/wikithttpd.tcl 2003/04/14 11:49:33 1.2 +++ lib/httpd/wikithttpd.tcl 2003/05/28 18:27:23 @@ -28,7 +28,7 @@ variable server #configure non-blocking, auto translation, default encoding - fconfigure $channel -blocking 0 -translation auto + fconfigure $channel -blocking 0 -translation auto -encoding utf-8 #the channel is now ready for reading of the http-header, #this should contain the encoding name (if any) that we'll set @@ -256,17 +256,23 @@ 5* { set status "Server Error" } default { set status "UNKNOWN_STATUS" } } + + # FIXME: If we want to make the encoding configurable, we will + # also need to convert the data "manually", using [encoding + # convertto], use [string length] for the Content-length, and + # [fconfigure -encoding binary] for the channel. + puts $channel "HTTP/1.0 $code $status" puts $channel "Server: $serverSoftware" puts $channel "Date: [httpTime]" puts $channel "Expires: [httpTime]" puts $channel "Connection: close" puts $channel "Accept-Ranges: bytes" - puts $channel "Content-Type: $type" - puts $channel "Content-Length: [string length $data]" + puts $channel "Content-Length: [string bytelength $data]" puts $channel "" - fconfigure $channel -translation "auto binary" + fconfigure $channel -translation "auto binary" -encoding utf-8 puts -nonewline $channel $data } Index: lib/wikit/web.tcl =================================================================== RCS file: /home/cvs/wikit/lib/wikit/web.tcl,v retrieving revision 1.100 diff -u -w -r1.100 web.tcl --- lib/wikit/web.tcl 2003/04/30 20:57:33 1.100 +++ lib/wikit/web.tcl 2003/05/28 18:27:25 @@ -3,9 +3,6 @@ package provide Web 1.0 package require cgi -# fix, as suggested by Ramon Ribo on c.l.tcl - Sep 19, 2002 -fconfigure stdout -encoding [encoding system] - # dump CGI env to file for debugging purposes if {[catch { set logfd [open $env(WIKIT_DUMP) a] @@ -199,6 +196,7 @@ pragma no-cache } head { title $name cgi_http_equiv Pragma no-cache cgi_http_equiv Expire "Mon, 04 Dec 1999 21:29:02 GMT" @@ -319,6 +317,7 @@ @ { # called to generate an edit page cgi_head { cgi_title "Edit $name" cgi_meta name=robots content=noindex,nofollow cgi_http_equiv Pragma no-cache @@ -355,6 +354,7 @@ ! { # called to generate a page with references cgi_head { cgi_title "References to $name" cgi_meta name=robots content=noindex,nofollow cgi_http_equiv Pragma no-cache @@ -393,6 +393,7 @@ default { # display one page, also handles expanded pages head { #if {$N == 4} { cgi_http_equiv refresh 300 } title $name cgi_http_equiv Pragma no-cache