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
--
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
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