Charset problems with partials


#1

Hi,

When using partials, I’m not able to keep the text posted as
ISO-8859-1, it changes to UTF-8.
The browser detects the page as ISO-8859-1, but I know the string from
the form is not
ISO-8859-1 when given to the method.

I’m able to keep the string as ISO-8859-1 if I don’t use any partials or
RJS.

This is how the view with partials and RJS looks like:

main.rhtml



Send it: <%= controller.action_name %>
<%= stylesheet_link_tag ‘nb’ %>

<%= render :partial => "publish" %>

_publish.rhtml



<%= form_remote_tag :url => { :action => 'publish' },
  :before => "Element.show('spinner');",
  :success => "show_results(xhr);",
  :failure => "show_error(xhr);",
  :complete => "Element.hide('spinner');",
  :html => { :id => 'thought-form' } %>

<br>Message:<br>
<%= text_area 'message', 'text', :maxlength => 60 %>

 <%= submit_tag 'Publish' %>
 <%= end_form_tag %>

<div id="thoughts">
</div>

publish.rjs:
page.replace_html ‘thoughts’, :partial => ‘status’
page.visual_effect :highlight, ‘thoughts’
page.form.reset ‘thought-form’

_status.rhtml


<%= flash[:notice] %>


<%= flash[:warning] %>


The code abow changes the input string to UTF-8, but the below does not.
How do I make sure the string is ISO-8859-1 through all of the
application?

plain_publish.rhtml




<%= form_tag :action => 'plainpublish' %>

<br>Message:<br>
<%= text_area 'message', 'text', :maxlength => 60 %>
<%= submit_tag 'Publish' %>
<%= end_form_tag %>

The methods are identical except for the name.

Any thoughts or suggestions are highly appreciated! :slight_smile:


Regards,
Martin S.


#2

I have exactly the same problem, Martin.

Did you find out a way to solve this?

Thanks!