Rails charachter encoding problem view to controller
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 btwThanks!
//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.
精彩评论