开发者

ISO-8859-1 encoded POST from external service to liferay; characters get garbled?

开发者 https://www.devze.com 2023-03-19 02:45 出处:网络
I\'m developing a custom autologin implementation in liferay, but I am having some character encoding issues. User authorization is done in an external service which then sends a POST back to liferay

I'm developing a custom autologin implementation in liferay, but I am having some character encoding issues. User authorization is done in an external service which then sends a POST back to liferay to be processed.. but the service uses ISO-8859-1 encoding and some characters (mainly nordic äöå chars) get garbled into unicode replacement characters (�) when returning.

I tried to use request.setCharacterEncoding() in the autologin filter 开发者_开发问答before processing any request parameters, and also manually processing the request parameters as bytedata with a different encoding. I also tried changing tomcat's server.xml elements to use the proper encoding, but none of the ways didn't seem to work. The characters seem to be replaced before being processed in the autologin filter; is there maybe a way to configure liferay to process the requests as ISO-8859-1 encoded instead of UTF-8? Or is there some other solution to this problem?

I'm using liferay 6.0.6 with tomcat 6 and spring portlet mvc. - I tried using org.springframework.web.filter.CharacterEncodingFilter too but it shouldn't have an effect on the hook anyways?

I thank you in advance for any feedback, and will gladly provide any further info if needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消