Get Garbled in SelectionPanel (fusion)

9 messages Options
Embed this post
Permalink
DOOTAKA

Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Hi

I want to display 2byte code character label in SelectionPanel, but I get garbled in the fusion viewer.
In ajax viewer, no ploblem.

Is it possible to display 2byte code character label in SelectionPanel?

*attached file is sample mgp file



GarbledSample.mgp
Paul Spencer

Re: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Um, I would expect that this is because the data coming from the  
fusion backend is not being properly encoded.  This came up recently  
on the list and the proposed solution was to wrap output of text in  
the utf8_encode function.

For the selection panel, this would probably be coming from mapguide/
php/Selection.php - if you modify this file to wrap the output in  
utf8_encode and it works, please let us know.

Cheers

Paul

On 23-Jun-08, at 4:26 AM, D.Ootaka wrote:

>
> Hi
>
> I want to display 2byte code character label in SelectionPanel, but  
> I get
> garbled in the fusion viewer.
> In ajax viewer, no ploblem.
>
> Can I display 2byte code character label in SelectionPanel?
>
> *attached file is sample mgp file
>
> http://www.nabble.com/file/p18064719/sample.png
>
> http://www.nabble.com/file/p18064719/GarbledSample.mgp 
> GarbledSample.mgp
> --
> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18064719.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
DOOTAKA

Re: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Thanks, Paul

I tried to wrap the output in utf8_encode, but not good...

1. wrap $result

Selection.php / Line 144
echo utf8_encode(var2json($result));

utf8_encode_result.png

2. wrap property value

Selection.php / Line 132
for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
    $result->$layerName->values[$iIndice][$k] = utf8_encode($properties->$layerName->values[$j][$k]);
}


utf8_encode_value.png

Regards.

Ootaka

Paul Spencer-5 wrote:
Um, I would expect that this is because the data coming from the  
fusion backend is not being properly encoded.  This came up recently  
on the list and the proposed solution was to wrap output of text in  
the utf8_encode function.

For the selection panel, this would probably be coming from mapguide/
php/Selection.php - if you modify this file to wrap the output in  
utf8_encode and it works, please let us know.

Cheers

Paul
Paul Spencer

Re: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Darn - ok, I just went and looked at what utf8_encode actually does  
(!) and its not what we want in this case, it encodes iso 8895-1  
characters as utf8 which is probably the generally useful case for  
most people but doesn't apply to double byte character sets.

I really don't understand character encoding at all, but I am willing  
to incorporate changes into fusion to make this work as long as it is  
generic enough to work in the common cases that I deal with too.  
Unfortunately I don't have the time to put into becoming educated  
about this right now ...

Can you spend some time looking into these functions (and the user  
comments that follow):

http://www.php.net/manual/en/function.utf8-encode.php
http://ca3.php.net/manual/en/book.iconv.php

and let us know what you find out?

Cheers

Paul

On 24-Jun-08, at 1:41 AM, D.Ootaka wrote:

>
> Thanks, Paul
>
> I tried to wrap the output in utf8_encode, but not good...
>
> 1. wrap $result
>
> Selection.php / Line 144
> echo utf8_encode(var2json($result));
>
> http://www.nabble.com/file/p18084122/utf8_encode_result.png
> utf8_encode_result.png
>
> 2. wrap property value
>
> Selection.php / Line 132
> for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
>    $result->$layerName->values[$iIndice][$k] =
> utf8_encode($properties->$layerName->values[$j][$k]);
> }
>
> http://www.nabble.com/file/p18084122/utf8_encode_value.png
> utf8_encode_value.png
>
> Regards.
>
> Ootaka
>
>
> Paul Spencer-5 wrote:
>>
>> Um, I would expect that this is because the data coming from the
>> fusion backend is not being properly encoded.  This came up recently
>> on the list and the proposed solution was to wrap output of text in
>> the utf8_encode function.
>>
>> For the selection panel, this would probably be coming from mapguide/
>> php/Selection.php - if you modify this file to wrap the output in
>> utf8_encode and it works, please let us know.
>>
>> Cheers
>>
>> Paul
>>
>
> --
> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18084122.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Måns Beckman

SV: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Hi,

I have had a quick look at this because I have the same problem with Swedish chars "ÅÄÖåäö". I didn't get the utf8_encode to work for me either, but I did see some interesting things in the JSON code.

Here is the output I get when I select one feature in the map.

{"layers":["Vägar-Text"],"extents":{"minx":93434.546699998,"miny":6217429.1614999,"maxx":102313.2338
,"maxy":6224177.9349999},"Vägar-Text":{"propertynames":["FeatId","GATUNAMN","VAGNR","ZOOMLEVEL"],"propertyvalues"
:["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"],"propertytypes":[7,9,9,9],"metadatanames":["dimension"
,"bbox","center","area","length"],"numelements":1,"values":[["1518","Christinelundsvägen
 (111)","111","level0"]],"metadata":[["","","","",""]]}}



What I think is really interesting is that:
The layers property is encoded correct - "layers":["Vägar-Text"],"
The property values are encoded correct - "propertyvalues":["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"]
But the values are encoded wrong - "values":[["1518","Christinelundsvägen (111)","111","level0"]] should be "values":[["1518","Christinelundsvägen (111)","111","level0"]]



The same data displays OK in the Ajax-viewer so it's not the values that are wrong. I'm kind of guessing that the error is in the place where we get the values from, and should be corrected there, and not in Selection.php.

Best regards
Måns

-----Ursprungligt meddelande-----
Från: [hidden email] [mailto:[hidden email]] För Paul Spencer
Skickat: den 24 juni 2008 12:58
Till: MapGuide Users Mail List
Ämne: Re: [mapguide-users] Get Garbled in SelectionPanel (fusion)

Darn - ok, I just went and looked at what utf8_encode actually does  
(!) and its not what we want in this case, it encodes iso 8895-1  
characters as utf8 which is probably the generally useful case for  
most people but doesn't apply to double byte character sets.

I really don't understand character encoding at all, but I am willing  
to incorporate changes into fusion to make this work as long as it is  
generic enough to work in the common cases that I deal with too.  
Unfortunately I don't have the time to put into becoming educated  
about this right now ...

Can you spend some time looking into these functions (and the user  
comments that follow):

http://www.php.net/manual/en/function.utf8-encode.php
http://ca3.php.net/manual/en/book.iconv.php

and let us know what you find out?

Cheers

Paul

On 24-Jun-08, at 1:41 AM, D.Ootaka wrote:

>
> Thanks, Paul
>
> I tried to wrap the output in utf8_encode, but not good...
>
> 1. wrap $result
>
> Selection.php / Line 144
> echo utf8_encode(var2json($result));
>
> http://www.nabble.com/file/p18084122/utf8_encode_result.png
> utf8_encode_result.png
>
> 2. wrap property value
>
> Selection.php / Line 132
> for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
>    $result->$layerName->values[$iIndice][$k] =
> utf8_encode($properties->$layerName->values[$j][$k]);
> }
>
> http://www.nabble.com/file/p18084122/utf8_encode_value.png
> utf8_encode_value.png
>
> Regards.
>
> Ootaka
>
>
> Paul Spencer-5 wrote:
>>
>> Um, I would expect that this is because the data coming from the
>> fusion backend is not being properly encoded.  This came up recently
>> on the list and the proposed solution was to wrap output of text in
>> the utf8_encode function.
>>
>> For the selection panel, this would probably be coming from mapguide/
>> php/Selection.php - if you modify this file to wrap the output in
>> utf8_encode and it works, please let us know.
>>
>> Cheers
>>
>> Paul
>>
>
> --
> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18084122.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Måns Beckman

SV: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
Hi,

Found a way to fix it!

I have tried both with my own datasets and the datasets with Japanese characters in them and my fix seems to work for both.

I'm not sure if I should post the fix here or on the fusion mail list, so if the right person just could have a look at it, I hope that the right person reads this email, and patch the code.

Ok, so in \WebServerExtensions\www\fusion\MapGuide\php\Utilities.php

Change row 863 from
$value = htmlentities($value);
To
$value = htmlentities($value,ENT_COMPAT,'UTF-8');

That would do the trick.

Best regards
Måns

-----Ursprungligt meddelande-----
Från: [hidden email] [mailto:[hidden email]] För Måns Beckman
Skickat: den 24 juni 2008 15:13
Till: MapGuide Users Mail List
Ämne: SV: [mapguide-users] Get Garbled in SelectionPanel (fusion)

Hi,

I have had a quick look at this because I have the same problem with Swedish chars "ÅÄÖåäö". I didn't get the utf8_encode to work for me either, but I did see some interesting things in the JSON code.

Here is the output I get when I select one feature in the map.

{"layers":["Vägar-Text"],"extents":{"minx":93434.546699998,"miny":6217429.1614999,"maxx":102313.2338
,"maxy":6224177.9349999},"Vägar-Text":{"propertynames":["FeatId","GATUNAMN","VAGNR","ZOOMLEVEL"],"propertyvalues"
:["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"],"propertytypes":[7,9,9,9],"metadatanames":["dimension"
,"bbox","center","area","length"],"numelements":1,"values":[["1518","Christinelundsvägen
 (111)","111","level0"]],"metadata":[["","","","",""]]}}



What I think is really interesting is that:
The layers property is encoded correct - "layers":["Vägar-Text"],"
The property values are encoded correct - "propertyvalues":["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"]
But the values are encoded wrong - "values":[["1518","Christinelundsvägen (111)","111","level0"]] should be "values":[["1518","Christinelundsvägen (111)","111","level0"]]



The same data displays OK in the Ajax-viewer so it's not the values that are wrong. I'm kind of guessing that the error is in the place where we get the values from, and should be corrected there, and not in Selection.php.

Best regards
Måns

-----Ursprungligt meddelande-----
Från: [hidden email] [mailto:[hidden email]] För Paul Spencer
Skickat: den 24 juni 2008 12:58
Till: MapGuide Users Mail List
Ämne: Re: [mapguide-users] Get Garbled in SelectionPanel (fusion)

Darn - ok, I just went and looked at what utf8_encode actually does  
(!) and its not what we want in this case, it encodes iso 8895-1  
characters as utf8 which is probably the generally useful case for  
most people but doesn't apply to double byte character sets.

I really don't understand character encoding at all, but I am willing  
to incorporate changes into fusion to make this work as long as it is  
generic enough to work in the common cases that I deal with too.  
Unfortunately I don't have the time to put into becoming educated  
about this right now ...

Can you spend some time looking into these functions (and the user  
comments that follow):

http://www.php.net/manual/en/function.utf8-encode.php
http://ca3.php.net/manual/en/book.iconv.php

and let us know what you find out?

Cheers

Paul

On 24-Jun-08, at 1:41 AM, D.Ootaka wrote:

>
> Thanks, Paul
>
> I tried to wrap the output in utf8_encode, but not good...
>
> 1. wrap $result
>
> Selection.php / Line 144
> echo utf8_encode(var2json($result));
>
> http://www.nabble.com/file/p18084122/utf8_encode_result.png
> utf8_encode_result.png
>
> 2. wrap property value
>
> Selection.php / Line 132
> for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
>    $result->$layerName->values[$iIndice][$k] =
> utf8_encode($properties->$layerName->values[$j][$k]);
> }
>
> http://www.nabble.com/file/p18084122/utf8_encode_value.png
> utf8_encode_value.png
>
> Regards.
>
> Ootaka
>
>
> Paul Spencer-5 wrote:
>>
>> Um, I would expect that this is because the data coming from the
>> fusion backend is not being properly encoded.  This came up recently
>> on the list and the proposed solution was to wrap output of text in
>> the utf8_encode function.
>>
>> For the selection panel, this would probably be coming from mapguide/
>> php/Selection.php - if you modify this file to wrap the output in
>> utf8_encode and it works, please let us know.
>>
>> Cheers
>>
>> Paul
>>
>
> --
> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18084122.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
zspitzer

Re: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
On Wed, Jun 25, 2008 at 6:27 PM, Måns Beckman
<[hidden email]> wrote:
> Hi,
>
> Found a way to fix it!
>
> I have tried both with my own datasets and the datasets with Japanese characters in them and my fix seems to work for both.
>
> I'm not sure if I should post the fix here or on the fusion mail list, so if the right person just could have a look at it, I hope that the right person reads this email, and patch the code.

sharing this sort of info on the mailing list is good,
trac is the place to find or file the bug and post your patch

http://trac.osgeo.org/fusion/

>
> Ok, so in \WebServerExtensions\www\fusion\MapGuide\php\Utilities.php
>
> Change row 863 from
> $value = htmlentities($value);
> To
> $value = htmlentities($value,ENT_COMPAT,'UTF-8');
>
> That would do the trick.
>
> Best regards
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]] För Måns Beckman
> Skickat: den 24 juni 2008 15:13
> Till: MapGuide Users Mail List
> Ämne: SV: [mapguide-users] Get Garbled in SelectionPanel (fusion)
>
> Hi,
>
> I have had a quick look at this because I have the same problem with Swedish chars "ÅÄÖåäö". I didn't get the utf8_encode to work for me either, but I did see some interesting things in the JSON code.
>
> Here is the output I get when I select one feature in the map.
>
> {"layers":["Vägar-Text"],"extents":{"minx":93434.546699998,"miny":6217429.1614999,"maxx":102313.2338
> ,"maxy":6224177.9349999},"Vägar-Text":{"propertynames":["FeatId","GATUNAMN","VAGNR","ZOOMLEVEL"],"propertyvalues"
> :["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"],"propertytypes":[7,9,9,9],"metadatanames":["dimension"
> ,"bbox","center","area","length"],"numelements":1,"values":[["1518","Christinelundsvägen
>  (111)","111","level0"]],"metadata":[["","","","",""]]}}
>
>
>
> What I think is really interesting is that:
> The layers property is encoded correct - "layers":["Vägar-Text"],"
> The property values are encoded correct - "propertyvalues":["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"]
> But the values are encoded wrong - "values":[["1518","Christinelundsvägen (111)","111","level0"]] should be "values":[["1518","Christinelundsvägen (111)","111","level0"]]
>
>
>
> The same data displays OK in the Ajax-viewer so it's not the values that are wrong. I'm kind of guessing that the error is in the place where we get the values from, and should be corrected there, and not in Selection.php.
>
> Best regards
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]] För Paul Spencer
> Skickat: den 24 juni 2008 12:58
> Till: MapGuide Users Mail List
> Ämne: Re: [mapguide-users] Get Garbled in SelectionPanel (fusion)
>
> Darn - ok, I just went and looked at what utf8_encode actually does
> (!) and its not what we want in this case, it encodes iso 8895-1
> characters as utf8 which is probably the generally useful case for
> most people but doesn't apply to double byte character sets.
>
> I really don't understand character encoding at all, but I am willing
> to incorporate changes into fusion to make this work as long as it is
> generic enough to work in the common cases that I deal with too.
> Unfortunately I don't have the time to put into becoming educated
> about this right now ...
>
> Can you spend some time looking into these functions (and the user
> comments that follow):
>
> http://www.php.net/manual/en/function.utf8-encode.php
> http://ca3.php.net/manual/en/book.iconv.php
>
> and let us know what you find out?
>
> Cheers
>
> Paul
>
> On 24-Jun-08, at 1:41 AM, D.Ootaka wrote:
>
>>
>> Thanks, Paul
>>
>> I tried to wrap the output in utf8_encode, but not good...
>>
>> 1. wrap $result
>>
>> Selection.php / Line 144
>> echo utf8_encode(var2json($result));
>>
>> http://www.nabble.com/file/p18084122/utf8_encode_result.png
>> utf8_encode_result.png
>>
>> 2. wrap property value
>>
>> Selection.php / Line 132
>> for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
>>    $result->$layerName->values[$iIndice][$k] =
>> utf8_encode($properties->$layerName->values[$j][$k]);
>> }
>>
>> http://www.nabble.com/file/p18084122/utf8_encode_value.png
>> utf8_encode_value.png
>>
>> Regards.
>>
>> Ootaka
>>
>>
>> Paul Spencer-5 wrote:
>>>
>>> Um, I would expect that this is because the data coming from the
>>> fusion backend is not being properly encoded.  This came up recently
>>> on the list and the proposed solution was to wrap output of text in
>>> the utf8_encode function.
>>>
>>> For the selection panel, this would probably be coming from mapguide/
>>> php/Selection.php - if you modify this file to wrap the output in
>>> utf8_encode and it works, please let us know.
>>>
>>> Cheers
>>>
>>> Paul
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18084122.html
>> Sent from the MapGuide Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> mapguide-users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>



--
Zac Spitzer -
http://zacster.blogspot.com (My Blog)
+61 405 847 168
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
DOOTAKA

Re: SV: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
In reply to this post by Måns Beckman
Hi all,

Thanks so much, Måns.
I checked some datasets with Japanese characters in them, and your fix works fine.

Additionally I tried that with MapGuide Enterprise 2009 (only pathed Utilities.php), and it's works fine too.
(IE7, Firefox3)

Thanks all.

Best Regards,

Ootaka

Mans Beckman wrote:
Hi,

Found a way to fix it!

I have tried both with my own datasets and the datasets with Japanese characters in them and my fix seems to work for both.

I'm not sure if I should post the fix here or on the fusion mail list, so if the right person just could have a look at it, I hope that the right person reads this email, and patch the code.

Ok, so in \WebServerExtensions\www\fusion\MapGuide\php\Utilities.php

Change row 863 from
$value = htmlentities($value);
To
$value = htmlentities($value,ENT_COMPAT,'UTF-8');

That would do the trick.

Best regards
Måns
Paul Spencer

Re: SV: Get Garbled in SelectionPanel (fusion)

Reply Threaded More More options
Print post
Permalink
In reply to this post by Måns Beckman
Great, thanks!  I saw you also filed a ticket, we'll make sure this  
gets into Fusion asap.

Cheers

Paul

On 25-Jun-08, at 4:27 AM, Måns Beckman wrote:

> Hi,
>
> Found a way to fix it!
>
> I have tried both with my own datasets and the datasets with  
> Japanese characters in them and my fix seems to work for both.
>
> I'm not sure if I should post the fix here or on the fusion mail  
> list, so if the right person just could have a look at it, I hope  
> that the right person reads this email, and patch the code.
>
> Ok, so in \WebServerExtensions\www\fusion\MapGuide\php\Utilities.php
>
> Change row 863 from
> $value = htmlentities($value);
> To
> $value = htmlentities($value,ENT_COMPAT,'UTF-8');
>
> That would do the trick.
>
> Best regards
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]
> ] För Måns Beckman
> Skickat: den 24 juni 2008 15:13
> Till: MapGuide Users Mail List
> Ämne: SV: [mapguide-users] Get Garbled in SelectionPanel (fusion)
>
> Hi,
>
> I have had a quick look at this because I have the same problem with  
> Swedish chars "ÅÄÖåäö". I didn't get the utf8_encode to work for me  
> either, but I did see some interesting things in the JSON code.
>
> Here is the output I get when I select one feature in the map.
>
> {"layers":["Vägar-Text"],"extents":{"minx":93434.546699998,"miny":
> 6217429.1614999,"maxx":102313.2338
> ,"maxy":6224177.9349999},"Vägar-Text":{"propertynames":
> ["FeatId","GATUNAMN","VAGNR","ZOOMLEVEL"],"propertyvalues"
> :["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"],"propertytypes":
> [7,9,9,9],"metadatanames":["dimension"
> ,"bbox","center","area","length"],"numelements":1,"values":
> [["1518","Christinelundsvägen
> (111)","111","level0"]],"metadata":[["","","","",""]]}}
>
>
>
> What I think is really interesting is that:
> The layers property is encoded correct - "layers":["Vägar-Text"],"
> The property values are encoded correct - "propertyvalues":
> ["FeatId","GATUNAMN","vägnummer","ZOOMLEVEL"]
> But the values are encoded wrong - "values":
> [["1518","Christinelundsvägen (111)","111","level0"]]  
> should be "values":[["1518","Christinelundsvägen  
> (111)","111","level0"]]
>
>
>
> The same data displays OK in the Ajax-viewer so it's not the values  
> that are wrong. I'm kind of guessing that the error is in the place  
> where we get the values from, and should be corrected there, and not  
> in Selection.php.
>
> Best regards
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]
> ] För Paul Spencer
> Skickat: den 24 juni 2008 12:58
> Till: MapGuide Users Mail List
> Ämne: Re: [mapguide-users] Get Garbled in SelectionPanel (fusion)
>
> Darn - ok, I just went and looked at what utf8_encode actually does
> (!) and its not what we want in this case, it encodes iso 8895-1
> characters as utf8 which is probably the generally useful case for
> most people but doesn't apply to double byte character sets.
>
> I really don't understand character encoding at all, but I am willing
> to incorporate changes into fusion to make this work as long as it is
> generic enough to work in the common cases that I deal with too.
> Unfortunately I don't have the time to put into becoming educated
> about this right now ...
>
> Can you spend some time looking into these functions (and the user
> comments that follow):
>
> http://www.php.net/manual/en/function.utf8-encode.php
> http://ca3.php.net/manual/en/book.iconv.php
>
> and let us know what you find out?
>
> Cheers
>
> Paul
>
> On 24-Jun-08, at 1:41 AM, D.Ootaka wrote:
>
>>
>> Thanks, Paul
>>
>> I tried to wrap the output in utf8_encode, but not good...
>>
>> 1. wrap $result
>>
>> Selection.php / Line 144
>> echo utf8_encode(var2json($result));
>>
>> http://www.nabble.com/file/p18084122/utf8_encode_result.png
>> utf8_encode_result.png
>>
>> 2. wrap property value
>>
>> Selection.php / Line 132
>> for($k=0; $k<count($properties->$layerName->values[$j]); $k++){
>>   $result->$layerName->values[$iIndice][$k] =
>> utf8_encode($properties->$layerName->values[$j][$k]);
>> }
>>
>> http://www.nabble.com/file/p18084122/utf8_encode_value.png
>> utf8_encode_value.png
>>
>> Regards.
>>
>> Ootaka
>>
>>
>> Paul Spencer-5 wrote:
>>>
>>> Um, I would expect that this is because the data coming from the
>>> fusion backend is not being properly encoded.  This came up recently
>>> on the list and the proposed solution was to wrap output of text in
>>> the utf8_encode function.
>>>
>>> For the selection panel, this would probably be coming from  
>>> mapguide/
>>> php/Selection.php - if you modify this file to wrap the output in
>>> utf8_encode and it works, please let us know.
>>>
>>> Cheers
>>>
>>> Paul
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Get-Garbled-in-SelectionPanel-%28fusion%29-tp18064719p18084122.html
>> Sent from the MapGuide Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> mapguide-users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users