[OpenLayers-Users] encoding international characters

Duarte Carreira DCarreira at edia.pt
Sun Apr 22 12:17:50 EDT 2007


Christopher,

Thanks for your tip.

Yes, I am now trying to find the correct settings for character
set/encoding.

In the html page I can set the html lang attribute, and also the http-equiv
charset tag.
Then in the asp that I call through ol, I can set the response.charset
attribute.
There is another asp I call through ajax, and here I can also set the
response.charset.

I seem to not be able to set all pages to the same setting to get correct
display on all fronts.

I'll try your tip and reply with the results.

Thanks again.
Duarte



Christopher Schmidt-4 wrote:
> 
> On Sun, Apr 22, 2007 at 05:03:11AM -0700, Duarte Carreira wrote:
>> For instance "ALC??CER" should encode to "ALC%C1CER", that's what the
>> browser
>> does if I write the query in the address box.
> 
> I have a feeling the difference here is related to character sets: the
> character you've just described should be encoded that way if it is in
> iso-8859-1, but not in UTF-8. It seems that the 'encodeURIComponent'
> Javascript function which is used (a Javascript builtin) is converting
> this to utf-8. It's not clear to me whether this is the 'right' thing or
> not, but it is certainly causing you problems.
> 
> A workaround is to override the encodeURIComponent functino by placing
> this as the first line of your init():
> 
>   encodeURIComponent = function(data) { return data; }
> 
> This will override the Javascript builtin, and cause OpenLayers to not
> encode your data. I can't speak to whether this is the 'right' thing to
> do, but it will let you move forward with the application.
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/encoding-international-characters-tf3626355.html#a10128006
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list