Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Fix for charset problem in Japanese wiki page

2004-12-12
2013-04-15
  • naoki iimura
    naoki iimura
    2004-12-12

    I implemented a patch for the charset problem in Japanese wiki pages.
    This problem is mentioned at this forum and the WikiTodo page:
    http://sourceforge.net/forum/message.php?msg_id=2578387
    http://popfile.sourceforge.net/cgi-bin/wiki.pl?WikiTodo

    > Japanese translated pages sometimes do not display correctly
    > because each page does not have charset declared in meta tag. A
    > hack of UseModWiki is required to add meta tag to each Japanese
    > page.

    Here is the patch (from UseModWiki 1.0):
    *** wiki.pl-10    Thu Sep 11 21:21:02 2003
    --- wiki.pl    Wed Dec 08 09:30:36 2004
    ***************
    *** 1321,1327 ****
    --- 1321,1331 ----
      sub GetHttpHeader {
        my ($type) = @_;
        my $cookie;
    +   my $charset = $HttpCharset;
     
    +   if ($OpenPageName =~ /^JP_/) {
    +     $charset = "Shift_JIS";
    +   }
        $type = 'text/html'  if ($type eq '');
        if (defined($SetCookie{'id'})) {
          $cookie = "$CookieName="
    ***************
    *** 1329,1342 ****
                  . "&id&" . $SetCookie{'id'}
                  . "&randkey&" . $SetCookie{'randkey'};
          $cookie .= ";expires=Fri, 08-Sep-2013 19:48:23 GMT";
    !     if ($HttpCharset ne '') {
            return $q->header(-cookie=>$cookie,
    !                         -type=>"$type; charset=$HttpCharset");
          }
          return $q->header(-cookie=>$cookie);
        }
    !   if ($HttpCharset ne '') {
    !     return $q->header(-type=>"$type; charset=$HttpCharset");
        }
        return $q->header(-type=>$type);
      }
    --- 1333,1346 ----
                  . "&id&" . $SetCookie{'id'}
                  . "&randkey&" . $SetCookie{'randkey'};
          $cookie .= ";expires=Fri, 08-Sep-2013 19:48:23 GMT";
    !     if ($charset ne '') {
            return $q->header(-cookie=>$cookie,
    !                         -type=>"$type; charset=$charset");
          }
          return $q->header(-cookie=>$cookie);
        }
    !   if ($charset ne '') {
    !     return $q->header(-type=>"$type; charset=$charset");
        }
        return $q->header(-type=>$type);
      }

    Can you merge this patch to the POPFile Documentation Project wiki?

    Naoki

     
    • naoki iimura
      naoki iimura
      2004-12-12

    • I have applied this change to the live Wiki, perhaps you can test it out?

      John.

       
      • naoki iimura
        naoki iimura
        2004-12-13

        John,

        Thanks. I've tested and there's no problem with Japanese charset.

        Naoki

         
        • Is it worth providing this fix back to the people who wrote UseModWiki in the first place?

          John.

           
          • Manni
            Manni
            2004-12-13

            The people that wrote UseModWiki could need hundreds of patches. The current version of UseMod was released in September 2003. To be honest, I hope that no new users are still installing UseMod. In other words: I wouldn't bother, John.

            Manni

             
          • naoki iimura
            naoki iimura
            2004-12-19

            John,

            I think it's useful for people who try to make English and Japanese documentations on UseModWiki, but I think they should support the other prefixes and languages (e.g. 'KR_' prefix means Korean).

            Naoki

             
    • naoki iimura
      naoki iimura
      2004-12-21

      From the beginning of December, we have a problem with
      editing Japanese wiki pages.
      When we are going to edit the Japanese pages, some
      characters (which contains 0x8b or 0x9b)
      are broken.

      I've made a patch and post it to the patch section:
      http://sourceforge.net/tracker/index.php?func=detail&aid=1089050&group_id=63137&atid=502958

      Naoki

       
      • naoki iimura
        naoki iimura
        2005-01-06

        John,

        This editing problem is very critical for Japanese Wiki editors.
        I think this problem may be due to the server update of SourceForge.net.

        Please merge my patch to wiki.pl.

        Naoki

         
        • Since you have access to wiki.pl, can you apply the patch?

          John.

           
          • naoki iimura
            naoki iimura
            2005-01-07

            I see. I'll try.

            Naoki

             
          • naoki iimura
            naoki iimura
            2005-01-07

            I've applied the patch and the problem has fixed.
            Thanks.

            Naoki