Hello again.

I hope anyone can really help me out here. I have been playing with different 
settings to correctly show all characters in PostGIS table (they are in 
Windows-1250) using P.mapper 4.2. And with following settings they appear like 
they should (in TOC and in result window):
-mapfile:
# 
LAYER
    NAME 'ko'
    TYPE POLYGON
    TEMPLATE void
CONNECTIONTYPE postgis
    CONNECTION "host=localhost dbname=dadabik_win1250 user=postgres 
password=admin port=5001"
DATA "geom FROM ko_zk_slo USING UNIQUE gid USING srid=3787"
    METADATA
      'ows_title' 'ko'
      "DESCRIPTION" "KATASTRSKE OBČINE"
      "LAYER_ENCODING" "Windows-1250"
  "RESULT_FIELDS" "sifko, imeko"
      "RESULT_HEADERS" "Šifra K.O., Ime K.O."
    END
    STATUS OFF
    TRANSPARENCY 90
    MINSCALE 0
    MAXSCALE 100000
    LABELITEM "imeko"
    LABELMAXSCALE 50000
    LABELMINSCALE 490
    CLASS
       NAME '蚞ȊŽ' 
       STYLE
         WIDTH 2.7
         OUTLINECOLOR 14256142
       END
       LABEL
          POSITION Auto
          COLOR 0 0 0
          TYPE truetype
          ENCODING "Windows-1250"
          FONT FreeSans
          SIZE 6
        END #Label
    END
  END
#

-config_xxx.xml
#
        <locale>
            <defaultLanguage>en</defaultLanguage>
            <defaultCharset>windows-1250</defaultCharset>
            <map2unicode>0</map2unicode>
        </locale>
#

The problem is with attribute search. It is impossible for me to execute search 
with string containing characters č, š, ž, Č, Š, Ž. They are also replaced with 
some weird characters (see pm_debug.log):
#
        <searchitem name="ko" description="K.O.">
            <layer type="postgis" name="ko">
                <field type="s" name="imeko" description="Ime K.O." 
wildcard="2">
                    <definition type="options" connectiontype="db" sort="asc" 
firstoption="*">                       
<dsn 
encoding="windows-1250">pgsql://postgres:admin@localhost:5001/dadabik_latin</dsn>
<sql>SELECT DISTINCT imeko, imeko FROM public.ko_zk_slo WHERE imeko IS NOT NULL 
ORDER BY imeko</sql>
                    </definition>
                </field>
            </layer>
        </searchitem>

search.php->getOptionsFromDb()->json
 { "ADLEŠIČI":"ADLE&Scaron;IÄŚI", "ADRIJANCI":"ADRIJANCI", "AJBA":"AJBA", 
"AJDOVEC":"AJDOVEC", "AJDOVŠČINA":"AJDOV&Scaron;ÄŚINA", "AMBRUS":"AMBRUS", 
"ANDRAŽ":"ANDRAĹ˝", "ANDREJCI":"ANDREJCI", "ANDRENCI":"ANDRENCI", 
"ANHOVO":"ANHOVO", "ANKARAN":"ANKARAN", "ANOVEC":"ANOVEC", "ANŽE":"ANĹ˝E", 
"APAČE":"APAÄŚE", "ARCLIN":"ARCLIN", "ARMEŠKO":"ARME&Scaron;KO", "ARNOVO 
SELO":"ARNOVO SELO", "ARTIČE":"ARTIÄŚE", "ARTVIŽE":"ARTVIĹ˝E", "AVBER":"AVBER", 
"AVČE":"AVÄŚE", ...

=>in json output left value is correct!

Searcharray in search.php->getSearchParameters() 
 Array
(
    [imeko] => ADLEĹ IÄŚI
    [mode] => search
)

[17-Apr-2012 00:45:59] P.MAPPER debug info 
Parameters for searchArray 
file: query.php->q_execAttributeQuery 

 Array
(
    [imeko] => ADLEĹ IÄŚI
    [mode] => search
)

[17-Apr-2012 00:45:59] P.MAPPER debug info 
Parameters for searchParams 
file: query.php->q_execAttributeQuery
 Array
(
    [layerName] => ko
    [layerType] => postgis
    [firstFld] => imeko
    [qStr] =>   imeko = 'ADLEĹ IÄŚI' 
)

[17-Apr-2012 00:45:59] P.MAPPER debug info 
P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
 SELECT gid, 
                         xmin(box3d(geom)), 
                         ymin(box3d(geom)), 
                         xmax(box3d(geom)), 
                         ymax(box3d(geom)), 
                         sifko,imeko 
                    FROM ko_zk_slo 
                   WHERE   imeko = 'ADLEĹ IÄŚI' 
                   LIMIT 301
#

To show characters like č, š, ž, Č, Š, Ž correctly in result window i had to 
comment out lines from 650-656 in query.php (maybe this is not the right thing 
to do because of the warning, but it works for me in result window otherwise it 
doesn't).


Any help is much appreciated!
Regards,
Miha


________________________________
 From: Miha Požauko <mp_s...@yahoo.com>
To: Pmapper <pmapper-users@lists.sourceforge.net> 
Sent: Wednesday, April 11, 2012 1:43 PM
Subject: Character encoding problem
 

Hey.

I'm having some problems with character encoding in search option list. my 
search parameters are defined like this:

        <searchitem name="ko" description="K.O.">
            <layer type="postgis" name="ko">
                <field type="s" name="imeko" description="Ime K.O." 
wildcard="2">
                    <definition type="options" connectiontype="db" sort="asc" 
firstoption="*">
                        <dsn 
encoding="ISO-8859-2">pgsql://postgres:luke@localhost:5001/dadabik_win1250</dsn>
<sql>SELECT DISTINCT imeko, imeko FROM public.ko_zk_slo WHERE imeko IS NOT NULL 
ORDER BY imeko</sql>
                    </definition>
                </field>
            </layer>
        </searchitem>

Characters č,š,ž,Č,Š,Ž are not showing correctly but are ok in query result, 
also labels are shown alright. my postgis database has windows-1250 
(ISO-8859-2) encoding. The problem is the same with every web browser.
Can anyone tell me what's wrong? Thanks!
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to