Bug: Creating topic in cyrillic produces error
Trying to save nonexisting topic with cyrillic (koi8-r) name produces:
"Software error:
Usage: Encode::FB_PERLQQ() at /usr/share/perl5/TWiki.pm line 742."
Test case
Set $useLocale = 1; $siteLocale = "ru_RU.KOI8-R"; $siteCharsetOverride = ""; $localeRegexes = 1;
Insert new link to nonexisting topic --
SomeNewNameInCyrillic. Then edit this
SomeNewNameInCyrillic? topic and try to save it.
Environment
--
VladimirPodryvanov - 04 Sep 2004
Follow up
Fix record
Changing "&FB_PERLQQ" to "&FB_PERLQQ()" at TWiki.pm line 742 resoves the error.
--
VladimirPodryvanov - 04 Sep 2004
Thanks Vladimir. This is now fix and in
SVN
Note: To fix TWiki on your own non-English site apply below patch and the one in
GermanUmlauteBreakWikiWords.
Modified: twiki/trunk/lib/TWiki.pm
===================================================================
--- twiki/trunk/lib/TWiki.pm 2004-09-01 18:36:08 UTC (rev 1743)
+++ twiki/trunk/lib/TWiki.pm 2004-09-05 04:53:17 UTC (rev 1744)
@@ -154,7 +154,7 @@
# ===========================
# TWiki version:
-$wikiversion = '01 Sep 2004 $Rev$';
+$wikiversion = '04 Sep 2004 $Rev$';
# ===========================
# Key Global variables, required for writeDebug
@@ -738,7 +738,7 @@
$fullTopicName = Encode::decode("utf8", $fullTopicName);
# - then convert into site charset from internal UTF-8,
# inserting \x{NNNN} for characters that can't be converted
- $fullTopicName = Encode::encode( $charEncoding, $fullTopicName, &FB_PERLQQ );
+ $fullTopicName = Encode::encode( $charEncoding, $fullTopicName, &FB_PERLQQ() );
##writeDebug "Encode result is $fullTopicName";
}
--
PeterThoeny - 05 Sep 2004
Thanks for the fix. This is rather odd - I spent some time with Linux Perl 5.8.3 and Encode.pm 1.99 getting this to work, so would be interested to hear whether other people have found the original syntax worked OK on pre-5.8.4 versions of Perl 5.8. (Also useful to know your
CPAN:Encode
version).
Another fix for
I18N in
CairoRelease now linked from
AppendixEncodeURLsWithUTF8.
--
RichardDonkin - 01 Oct 2004
I get the same issue with Cygwin Perl 5.8.5 and Encode 2.01, though it worked OK on Cygwin Perl 5.8.0 on my previous PC and on Linux Perl 5.8.3 with Encode 1.99 - this goes against the normal syntax of constants (see
perldoc constant, they are inlinable subroutines in reality) but appears to be how Encode does things. An alternative would be to write
no strict 'subs' in this block.
With this fix, the fallback routine really does work, generating
\x{fffd} etc.
Note: This problem can happen with any TWiki site that (1) enables
I18N using a non-ISO-8859-1 site character set and (2) uses Perl 5.8. Other sites won't use
CPAN:Encode
in that code path.
UPDATE: This may also be something to do with the fact that we aren't doing a normal compile-time 'use Encode' - the Perl Cookbook, First Edition, p 406, mentions (when discussing
CPAN:autouse
), that constants must be used with a () if you do a run-time 'require and import'. However it's not clear why this changed in a new Encode version...
--
RichardDonkin - 08 Dec 2004
Apparently this is fixed..... I assume in MAIN?
--
CrawfordCurrie - 13 Feb 2005