bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] strcasecmp and turkish locale


From: Tim Ruehsen
Subject: [Bug-wget] strcasecmp and turkish locale
Date: Wed, 24 Sep 2014 13:08:21 +0200
User-agent: KMail/4.14.1 (Linux/3.16-2-amd64; KDE/4.14.1; x86_64; ; )

Hi people,

Wget is using strcasecmp() for it's case-insensitive strings comparisons.

But strcasecmp() is locale-dependent and in a turkish locale, I converts to ı 
and İ converts to i. 

In most cases we want Wget to make a ASCII comparison and not a locale 
dependent one. It seems that there is no standardized function to do this job.
But there seems a function called c_strcasecmp() in the gnulib ;-) so I guess 
the solutions is easy.

See also
http://lists.gnu.org/archive/html/bison-patches/2007-02/msg00007.html
http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/

The test suite (make check) executes wget with LC_ALL=C and not with the 
current locale (as I expected). So to make the above problem visible you have 
to install a turkish locale (e.g. tr_TR.utf8) and run

        cd tests; LC_ALL=tr_TR.utf8 ./run-px ..

or for the new test suite

        TESTS_ENVIRONMENT="LC_ALL=tr_TR.utf8" make check

Before, you should also apply a diff like this
diff --git a/testenv/Test-Content-disposition.py b/testenv/Test-Content-
disposition.py
index 027a9e8..ba50674 100755
--- a/testenv/Test-Content-disposition.py
+++ b/testenv/Test-Content-disposition.py
@@ -20,7 +20,7 @@ File1 = """All that is gold does not glitter,
 
 File1_rules = {
     "SendHeader"        : {
-        "Content-Disposition" : "Attachment; filename=JRR.Tolkein"
+        "Content-Disposition" : "Attachment; fIlename=JRR.Tolkein"
     }
 }
 A_File = WgetFile ("LOTR", File1, rules=File1_rules)
diff --git a/tests/Test-HTTP-Content-Disposition.px b/tests/Test-HTTP-Content-
Disposition.px
index ed17b08..e542aa2 100755
--- a/tests/Test-HTTP-Content-Disposition.px
+++ b/tests/Test-HTTP-Content-Disposition.px
@@ -28,7 +28,7 @@ my %urls = (
         msg => "Dontcare",
         headers => {
             "Content-type" => "text/html",
-            "Content-Disposition" => "attachment; 
filename=\"filename.html\"",
+            "Content-Disposition" => "attachment; 
fIlename=\"filename.html\"",
         },
         content => $dummyfile,
     },


BTW, are there any objections against changing the old test suite from serial  
to parallel ? That would allow the use of TESTS_ENVIRONMENT and of make check 
-jx.


Tim

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]