Tags:
create new tag
, view all tags

Question

I've installed CommentPlugin on TWikiRelease01Feb2003 with locale bg_BG.KOI8-R. Topic names in cyrillic works fine. But when comment is added to topic with cyrillic characters in its name, new topic is created with all koi8-r characters turned into utf-8 characters, but shown in koi8-r encoding. This renders CommentPlugin unusable for topic names with cyrillic.

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, CommentPlugin
Server OS: Debian testing 20040410 (will become Debian Sarge)
Web server: Apache 2.0.48-7
Perl version: 5.8.3-2
Client OS: Debian unstable 20040410
Web Browser: Mozilla Firefox 0.7-7

-- OgnyanKulev - 10 Mar 2004

Answer

RichardDonkin suggested using %INTURLENCODE{...}%. I tracked where CommentPlugin sets action attribute to its form element, but the codes looks like this:

$url = TWiki::Func::getScriptUrl( $web, $topic, "save" );

Where getScriptUrl is essentially this:

return "$urlHost$scriptUrlPath/$theScript$scriptSuffix/$theWeb/$theTopic";

I replaced $theTopic with %INTURLENCODE{$theTopic}%, and it works smile

Is this legal?

-- OgnyanKulev - 10 Mar 2004

Your patch looks fine and will work OK - the other approach is simply to use TWikiBetaRelease, which includes EncodeURLsWithUTF8 that avoids this problem (which is Mozilla-specific by the way - other browsers can be configured not to use UTF-8 URLs at all).

I would recommend something more like this, though, to enable use of Bulgarian web names as well as topic names:

return "$urlHost$scriptUrlPath/$theScript$scriptSuffix/%INTURLENCODE{$theWeb/$theTopic"}%;

Plugins that generate forms within TWiki pages need to follow the guidelines in InternationalisingYourSkin, unless their users are willing to upgrade to the latest TWikiBetaRelease (strongly recommended for anyone using TWiki I18N features, since the beta is very stable).

Please also comment on CommentPluginDev, so that plugin's developers are aware of this.

-- RichardDonkin - 10 Mar 2004

Topic attachments
I Attachment Action Size Date Who Comment
htmlhtml testenv.html manage 10.5 K 10 Mar 2004 - 17:26 OgnyanKulev testenv output
Topic revision: r3 - 11 Mar 2004 - 07:56:47 - PeterThoeny
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback