Display utf 8 characters in text fields in edit page

I have no problems displaying data from my database with characters
like é à è etc. anywhere in my application; however on my edit page,
when it tries to display the data in the text fields I get
incompatible character encoding errors. Any ideas?

<% for c in @attribute_columns do %>
<%= f.text_field c.second %>

On 14, April 2010, at 14 Apr 19:58, ES wrote:

I have no problems displaying data from my database with characters
like é à è etc. anywhere in my application; however on my edit page,
when it tries to display the data in the text fields I get
incompatible character encoding errors. Any ideas?

<% for c in @attribute_columns do %>
<%= f.text_field c.second %>

What version of Rails are you running?

Mikel

I’m running Rails 2.3.5

I have still not found a solution to this. Does anyone have an idea?

I think it could be browser issue. Check your addons in your browsers or
try

different clean browsers to see the issue occurring.

Maybe desktop has been configured to ascii language editor. Try in
a different computer.

Make sure that Database columns are utf8 compatible in the database.
database.yml should contain encoding: utf8

On 21 April 2010 09:40, ES [email protected] wrote:

like é à è etc. anywhere in my application; however on my edit page,

Nandri(Thanks in Tamil),
Amala S.

It works if I write this as the value for the text field:

value="<%= @echantillon[‘material’].force_encoding(‘UTF-8’) %> "

Which means that when it is doing the SELECT from the database, it is
not selecting it in UTF-8. How can I force it to do selects in UTF-8?

ES wrote:

It works if I write this as the value for the text field:

value="<%= @echantillon[‘material’].force_encoding(‘UTF-8’) %> "

Which means that when it is doing the SELECT from the database, it is
not selecting it in UTF-8. How can I force it to do selects in UTF-8?

Is the database using UTF-8? Is Rails connecting to it with UTF-8
encoding? Is UTF-8 encoding specified in your page headers?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

you dont need to do this, if your setup is correct.

On 22 April 2010 18:08, ES [email protected] wrote:

On Apr 21, 10:40 am, ES [email protected] wrote:

On 14, April 2010, at 14 Apr 19:58, ES wrote:
What version of Rails are you running?
For more options, visit this group athttp://
http://groups.google.com/group/rubyonrails-talk?hl=en.

Nandri(Thanks in Tamil),
Amala S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs