You are here: Foswiki>Tasks Web>Item13881 (08 Feb 2016, GeorgeClark)Edit Attach

Item13881: Table header problem in unicode named web/topic

Priority: Normal
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Extension
Component: EditRowPlugin
Branches: master Release02x00 Item13897
Reported By: JozefMojzis
Waiting For: GeorgeClark
Last Change By: GeorgeClark


Check here:

and click to any table header. - Will report nonexistent web/topic.

-- JozefMojzis - 02 Dec 2015

I have a fix, but I don't know why it's needed where it's needed.

diff --git a/TablePlugin/lib/Foswiki/Plugins/TablePlugin/ b/TablePlugin/lib/Foswiki/Plugins/TablePlugin/
index a9f230d..e315211 100644
--- a/TablePlugin/lib/Foswiki/Plugins/TablePlugin/
+++ b/TablePlugin/lib/Foswiki/Plugins/TablePlugin/
@@ -1893,7 +1893,7 @@ sub handler {
         @origTable = $cgi->multi_param('table');
         @origUp    = $cgi->multi_param('up');        # NOTE: internal parameter
         $cgi->delete( 'sortcol', 'table', 'up' );
-        $url = $cgi->url( -absolute => 1, -path => 1 ) . '?';
+        $url = Foswiki::decode_utf8($cgi->url( -absolute => 1, -path => 1 ) . '?');
         my $queryString = $cgi->query_string();
         if ($queryString) {
             $url .= $queryString . ';';

The thing that concerns me is that I've looked at the other places that call cgi URL, and they are not doing decode_utf8.

-- GeorgeClark - 03 Dec 2015

I've checked in the fix. Still though question if Foswiki::Request::url() shouldn't return a unicode string instead of needing the caller to do it.

-- AdminUser - 11 Dec 2015

As I understand it, Foswiki::Reponse::uri is intended to be as code-compatible with HTTP::Response as possible. However uri() doesn't seem to be part of this protocol (see so if (and only if) this isn't an implementation of an internal method with hidden but defined semantics, it should be all right to enhance it with a decode. Make sure it isn't used anywhere else, though.

-- Main.CrawfordCurrie - 28 Dec 2015 - 07:35

It's url not uri, and that is implemented in CGI. I can't find anywhere that documents if the CGI function does any decoding of the ULR, so I think we should probably not change the url subroutine. I'll add some documentation into Foswiki::Request. Actually I wonder if this might be related to running CGI with the qw( -utf8 ) pragma. CGI returns byte strings unless the -utf8 pragma is enabled.

-- GeorgeClark - 30 Dec 2015
Topic revision: r8 - 08 Feb 2016, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy