Dejan,

originally I wanted also the map file to be in UTF-8. I just got errors that
crashed the PHP process when doing so. So I still kept the map file in
LATIN1 and used utf8_encode to put everything to UTF8. 

You can try to put the map file in Unicode (having map2unicode=0) and see if
it works for you. You need an editor that supports UTF (I use Scite). A
solution that should work is to use ascii characters in the map file and add
the strings to the language_xx.php file (they have to be in UTF).

I have been thinking that this mentioned encoding does not require PHP to
have libiconv be compiled in, because the (incomplete) PHP docs do not say
anything like that. But in fact, libiconv is required for utf8_encode. So in
this case I can as well use the more flexible 'iconv()' that allows to
define in and out encoding. That would also solve your problem. One then
needs to have a Metadata tag specifying the encoding of the map file.

I guess that I have to go the more strict way and require iconv to be
compiled into PHP when using anything else than ASCII. Maybe Latin1 will
also work.

LAYER_ENCODING will probably have to be the same as ENCODING (but that is
defined just in case of labels).

I would not try to use pmapper in anything else than UTF8 or Latin1, you
will very likely end up in unresolved encoding errors.

armin

   

> --- Urspr?ngliche Nachricht ---
> Von: "Gambin Dejan" <Dejan.Gambin at pula.hr>
> An: <pmapper-users at faunalia.it>
> Betreff: [Pmapper-users] Encoding in pmapper-1.2.0
> Datum: Thu, 4 May 2006 13:56:51 +0200
> 
> Hi,
> 
> I have some questions regarding the "new" multilingual interface and
> encoding.
> 
> The documentation says the default character encoding is UTF-8. This is
> defined through defCharset parameter in config.ini I suppose (I can see
> it is only used in common.php for header building). 
> 
> First, for the map file, what if I have DESCRIPTION or CLASS names in
> some other encoding? If I understand correctly, I can use map2unicode=1.
> But this causes using utf8_encode function and this function encodes the
> string to UTF-8 but it assumes the input string is in latin1
> (ISO8859-1). So if my map file is using the encoding different from
> ISO-8859-1, this will not work correctly? For example we are using
> ISO-8859-2 or win-1250 encodings. What is the best way to correctly
> display my DESCRIPTION and CLASS names if they contain some special
> Croatian characters? I suppose I can't edit map file using UTF-8
> encoding?
> 
> Second, for query results, is the LAYER_ENCODING metadata parameter
> somehow related to label ENCODING parameter in mapfile?
> 
> Third, what if I want to use some other defCharset? What is the best way
> to go? At this moment I have an older pmapper version that I had to
> modify for correctly work with my data (I a displaying data on HTML page
> in ISO-8859-2, but my dbf shape files have data in WIN-1250). What do
> you suggest?
> 
> I think it would be the best to use UTF-8 for HTML displaying, with
> LAYER_ENCODING for correct querying....so only thing left to do is
> displaying some strings with special characters from the map file...
> 
> thanks very much
> 
> dejan
> 
> _______________________________________________
> Pmapper-users mailing list
> Pmapper-users at faunalia.it
> http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users
> 

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

Reply via email to