Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Milo van der Linden
Hello Andreas;

What return type of getfeatureinfo are you using?
There are three possibilities: http://mapserver.org/ogc/wms_server.html

1. text/plain
2. text/html
3. gml

If you use text/html; you can set the character encoding to windows ansi:

http://www.w3.org/International/questions/qa-html-encoding-declarations#quicklookup

If you use GML, because it is a flavour of XML, mapserver MUST serve
UNICODE:(UTF-8 or UTF-16);http://www.w3.org/TR/REC-xml/#sec-well-formed  So
if the gml output is not converted to unicode; please file a ticket for this
matter in the osgeo trac database.


2011/2/8 Tom van der Putte t...@vdputte.nl

 Hi Andreas,

 i looked it up, you can find it here:

 http://resources.arcgis.com/content/kbase?fa=articleShowd=21106

 Unfortunately I'm not aware of any means to automate the process of
 exporting the shapefiles, so you'd have to do it by hand.

 Tom

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Milo van der Linden
I found a ticket that is related to this issue:
http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode


2011/2/9 Milo van der Linden m...@dogodigi.net

 Hello Andreas;

 What return type of getfeatureinfo are you using?
 There are three possibilities: http://mapserver.org/ogc/wms_server.html

 1. text/plain
 2. text/html
 3. gml

 If you use text/html; you can set the character encoding to windows ansi:


 http://www.w3.org/International/questions/qa-html-encoding-declarations#quicklookup

 If you use GML, because it is a flavour of XML, mapserver MUST serve
 UNICODE:(UTF-8 or UTF-16);http://www.w3.org/TR/REC-xml/#sec-well-formed
 So if the gml output is not converted to unicode; please file a ticket for
 this matter in the osgeo trac database.


 2011/2/8 Tom van der Putte t...@vdputte.nl

  Hi Andreas,

 i looked it up, you can find it here:

 http://resources.arcgis.com/content/kbase?fa=articleShowd=21106

 Unfortunately I'm not aware of any means to automate the process of
 exporting the shapefiles, so you'd have to do it by hand.

 Tom

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Siegel Andreas
Hi Tom.
 
Thanks for your reply. But no, it is not an issue with ArcGIS.
The link you sent me may prove useful anyway since we rely heavy on shapefiles 
and ArcGIS ist used by several of our colleges and contributors.
 
My issue is this line of code:
meta http-equiv=Content-Type content=text/html; charset=MacThai/meta
Please note the charset MacThai. 
This charset should render my results illegible but it has no effect at all.
 
I test it by using a browser:
http://vogis.cnv.at/mapserver/mapserv?map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30
 
 and the commandline.
./mapserv -nh 
QUERY_STRING=map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30

The commandline output can be inspected by hexdump -C
 
./mapserv -nh 
QUERY_STRING=map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30
 | hexdump -c
 
This allows to inspect the result without some unwanted/unnoticed code 
translations when using an editor or the browser,

This are the HTML-Templates:
Header:
!-- MapServer Template --
 
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/transitional.dtd 
http://www.w3.org/TR/html4/transitional.dtd 
 
html
 
head
 
 !-- enforce the client to display result html as UTF-8 encoding --
 meta http-equiv=Content-Type content=text/html; charset=MacThai/meta
 
 style type=text/css
 
  table, th, td {
   border:1px solid #e5e5e5;
   border-collapse:collapse;
   font-family: arial;
   font-size: 80%;
   color: #33
  }
 
  th, td {
   valign: top;
   text-align: center;
  }
 
 th {
  background-color: #aed7ff
 }
 
 caption {
  border:1px solid #e5e5e5;
  border-collapse:collapse;
  font-family: arial;
  font-weight: bold;
  font-size: 80%;
  text-align: left;
  color: #33;
 }
 
 /style
 titleGetFeatureInfo Response/title
/head
 
body
 table
 
  captionWidmungsart Zeichensatztest ae ä oe ö ue ü AE Ä OE Ö UE Ü scharfes s 
ß Ende/caption
 
 tbody
  thKuerzel/th
  thWidmungsart/th
  thFlaeche/th
  thText/th
 
 
TEMPLATE:
 !-- MapServer Template --
 tr
   td[item name=WI_EM_KN format=$value escape=none]/td
   td[item name=WI_EM_TXT format=$value escape=none]/td
   td[item name=Flaeche format=$value escape=none]/td
   td[item name=FS_TXT  format=$value escape=none]/td
 /tr
 
 
FOOTER:
 !-- MapServer Template --
   /tbody
 /table
 br/
   /body
/html
 
 
 
 
 


 
 
 
 
 
 
 
Mag Andreas Siegel
Landesvermessungsamt Feldkirch
Johannitergasse 6, A-6800 Feldkirch
Tel: +43(0) 5522 / 75482 - 60227
Fax: +43(0) 5522 / 75482 - 6
E-Mail: andreas.sie...@vorarlberg.at 
mailto:andreas.andreas.sandreas.sie...@vorarlberg.at 
http://www.vorarlberg.at/lva
 
Rechtsverbindlichen Schriftverkehr
(zB Anträge, Rechtsmittel) richten Sie an:
E-Mail: landesvermessungs...@vorarlberg.at
Fax: +43(0)5522/75482-6
 
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Milo van der Linden
There are errors in the usage of 

I think that:

meta http-equiv=Content-Type content=text/html;
charset=x-mac-thai/meta

is the correct one.


http://www.w3.org/International/O-HTTP-charset


2011/2/9 Siegel Andreas andreas.sie...@vorarlberg.at

  Hi Tom.

 Thanks for your reply. But no, it is not an issue with ArcGIS.
 The link you sent me may prove useful anyway since we rely heavy on
 shapefiles and ArcGIS ist used by several of our colleges and contributors.

 My issue is this line of code:
 meta http-equiv=Content-Type content=text/html;
 charset=MacThai/meta
 Please note the charset MacThai.
 This charset should render my results illegible but it has no effect at
 all.

 I test it by using a browser:

 http://vogis.cnv.at/mapserver/mapserv?map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30

  and the commandline.
 ./mapserv -nh
 QUERY_STRING=map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30
  The commandline output can be inspected by hexdump -C

 ./mapserv -nh
 QUERY_STRING=map=a.mapLAYERS=umlauttestSERVICE=WMSVERSION=1.1.1REQUEST=GetFeatureInfoSTYLES=EXCEPTIONS=application/vnd.ogc.se_xmlFORMAT=image/jpegSRS=EPSG:31254BBOX=-49500,246750,-49000,247250X=250Y=250INFO_FORMAT=text/htmlQUERY_LAYERS=umlauttestWIDTH=650HEIGHT=650FEATURE_COUNT=30
 | hexdump -c

 This allows to inspect the result without some unwanted/unnoticed code
 translations when using an editor or the browser,

 This are the HTML-Templates:
 Header:
 !-- MapServer Template --

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
 http://www.w3.org/TR/html4/transitional.dtd;

 html

 head

  !-- enforce the client to display result html as UTF-8 encoding --
  meta http-equiv=Content-Type content=text/html;
 charset=MacThai/meta

  style type=text/css

   table, th, td {
border:1px solid #e5e5e5;
border-collapse:collapse;
font-family: arial;
font-size: 80%;
color: #33
   }

   th, td {
valign: top;
text-align: center;
   }

  th {
   background-color: #aed7ff
  }

  caption {
   border:1px solid #e5e5e5;
   border-collapse:collapse;
   font-family: arial;
   font-weight: bold;
   font-size: 80%;
   text-align: left;
   color: #33;
  }

  /style
  titleGetFeatureInfo Response/title
 /head

 body
  table

   captionWidmungsart Zeichensatztest ae ä oe ö ue ü AE Ä OE Ö UE Ü
 scharfes s ß Ende/caption

  tbody
   thKuerzel/th
   thWidmungsart/th
   thFlaeche/th
   thText/th


 TEMPLATE:
  !-- MapServer Template --
  tr
td[item name=WI_EM_KN format=$value escape=none]/td
td[item name=WI_EM_TXT format=$value escape=none]/td
td[item name=Flaeche format=$value escape=none]/td
td[item name=FS_TXT  format=$value escape=none]/td
  /tr


 FOOTER:
  !-- MapServer Template --
/tbody
  /table
  br/
/body
 /html














  *Mag Andreas Siegel*
 Landesvermessungsamt Feldkirch
 Johannitergasse 6, A-6800 Feldkirch
 Tel: +43(0) 5522 / 75482 - 60227
 Fax: +43(0) 5522 / 75482 - 6
  E-Mail: 
 andreas.sie...@vorarlberg.atandreas.andreas.sandreas.sie...@vorarlberg.at
 http://www.vorarlberg.at/lva

 Rechtsverbindlichen Schriftverkehr
 (zB Anträge, Rechtsmittel) richten Sie an:
 E-Mail: landesvermessungs...@vorarlberg.at
 Fax: +43(0)5522/75482-6


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Daniel Morissette

On 11-02-08 09:37 AM, Siegel Andreas wrote:

Hi.
Our mapserver-eniromnent entirely works in utf-8 (mapfiles, webserver,
postgres, ..) with one exception, that is, all of our shapefiles.
The shapfiles are created/updated in an Windows-environment by several,
external contributors.
Hence they are encoded in Wiindows-ANSI (cp: 1252).
If i do an GetFeatureInfo-Request on the attibutes of the shapefiles all
special characters (umlauts) are garbled.
This is no wonder since the content of the shapefile-attributes must be
recoded to utf-8 prior to insertion in the template.html.
How can this be acomplished? I could not find anything useful in the
documentation or with google.


The short answer is that there is no mechanism in MapServer at the 
moment to convert encoding of attributes displayed in a query template, 
so your only options are to either change the encoding of the data files 
to UTF-8, or change the template.html and its header to match the 
encoding of the data. (The only place where MapServer supports encoding 
conversion at the moment is in map labels, see the ENCODING keyword in 
the LABEL docs.)


Of course this could be a nice enhancement to MapServer if there was a 
group interested in funding it.


Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-09 Thread Yewondwossen Assefa

On 09/02/2011 7:34 AM, Daniel Morissette wrote:

On 11-02-08 09:37 AM, Siegel Andreas wrote:

Hi.
Our mapserver-eniromnent entirely works in utf-8 (mapfiles, webserver,
postgres, ..) with one exception, that is, all of our shapefiles.
The shapfiles are created/updated in an Windows-environment by several,
external contributors.
Hence they are encoded in Wiindows-ANSI (cp: 1252).
If i do an GetFeatureInfo-Request on the attibutes of the shapefiles all
special characters (umlauts) are garbled.
This is no wonder since the content of the shapefile-attributes must be
recoded to utf-8 prior to insertion in the template.html.
How can this be acomplished? I could not find anything useful in the
documentation or with google.


The short answer is that there is no mechanism in MapServer at the 
moment to convert encoding of attributes displayed in a query 
template, so your only options are to either change the encoding of 
the data files to UTF-8, or change the template.html and its header to 
match the encoding of the data. (The only place where MapServer 
supports encoding conversion at the moment is in map labels, see the 
ENCODING keyword in the LABEL docs.)


Of course this could be a nice enhancement to MapServer if there was a 
group interested in funding it.


Daniel


Sorry to jump late on this. This issue I believe was identified and 
described in the trac bug [1]. An incomplete solutions was proposed in 
there but It definitely need more thinking.


[1] http://trac.osgeo.org/mapserver/ticket/3297

Assefa

--

Assefa Yewondwossen
Software Analyst

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-08 Thread Jeff McKenna

Hello,

A quick thought that I had when I read your issue, is that I recently 
came across a similar issue when I was working with Japanese data.  In 
that case for MapServer to display query results in my template 
properly, I had to change the character set in the HTML template file, 
otherwise the characters would be garbled:


!-- MapServer Template --
html
head
meta http-equiv=Content-Type content=text/html; charset=Shift_JIS
title照会/title
...

I'm not sure if that is related to your exact issue, but those are my 
quick thoughts.


-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 11-02-08 10:37 AM, Siegel Andreas wrote:

Hi.
Our mapserver-eniromnent entirely works in utf-8 (mapfiles, webserver,
postgres, ..) with one exception, that is, all of our shapefiles.
The shapfiles are created/updated in an Windows-environment by several,
external contributors.
Hence they are encoded in Wiindows-ANSI (cp: 1252).
If i do an GetFeatureInfo-Request on the attibutes of the shapefiles all
special characters (umlauts) are garbled.
This is no wonder since the content of the shapefile-attributes must be
recoded to utf-8 prior to insertion in the template.html.
How can this be acomplished? I could not find anything useful in the
documentation or with google.
*Mag Andreas Siegel*

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

2011-02-08 Thread Tom van der Putte
Hi
Andreas,
 i looked it up, you can find it here:
 http://resources.arcgis.com/content/kbase?fa=articleShowd=21106
 Unfortunately I'm not aware of any means to automate the process of
exporting the shapefiles, so you'd have to do it by hand.
 Tom
  ___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users