Dear Armin,

I got in trouble with attribute search on Linux when the locale LANG is 
other than the shape file encoding. I use version 4.2.0.
In my case LANG=en_US.UTF-8 and LAYER_ENCODING is ISO-8859-2. The problem is 
caused by the following line in suggest.php in function msSuggestMatch 
$val = preg_replace ("/\w/ie", "'('. strtoupper('$0') . '|' . strtolower('$0') 
.')'", $searchVal);

The strtoupper depends on locale settings. Another thing is "e" 
(PREG_REPLACE_EVAL) is depricated as of PHP 5.5.0.

I suggest the preg_replace should be replaced by a function like this:
function buildRegexp($s, $encoding) {
         $res = "";
         $n = strlen($s);
         for ($i = 0; $i < $n; $i++) {
             $a = mb_strtolower($s[$i], $encoding);
             $A = mb_strtoupper($s[$i], $encoding);
             if ($a == $A) {
                 $res .= $a;
             } else {
                 $res .= "($A|$a)";
             }
         }
         return $res;
     }

The same problem was found in search.php in function getSearchParamsShp at 
the line with preg_replace.

Regards,
Zoltan

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to