开发者

Rails charachter encoding problem view to controller

开发者 https://www.devze.com 2023-01-07 00:42 出处:网络
The character encoding starts to ir开发者_StackOverflow中文版ritate me. It took me a while to get everything from the DB in the right encoding on the screen, but with help from the i18n helper, this w

The character encoding starts to ir开发者_StackOverflow中文版ritate me.

It took me a while to get everything from the DB in the right encoding on the screen, but with help from the i18n helper, this worked out.

Now I only have one more problem: saving text...

If i add some letters with accents (eg é ç ...) in a text field and want to save it, already in my controller it show as some exotic combination of characters.

Could someone tell me why this is and how I can fix this.

Everything is in UTF-8 btw

Thanks!

//Edit: When I save the form, this is my log output

Parameters: {"free_text"=>"test 1 2 é",

And everything is capable of UTF-8...


Can you illustrate your output?

Let me guess your situation.

Supposed that you log those characters in controller in log/development.log or production.log.

If you view that log in terminal, you should ensure your terminal is capable to show UTF-8, with appropriate font. Also, your shell is capable to show UTF-8 and so do your the text viewer.

0

精彩评论

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