# Charset problems with partials

**URL:** <https://www.ruby-forum.com/t/charset-problems-with-partials/107526>\
**Category:** Rails\
**Created:** [June 22, 2007, 4:27pm UTC](https://www.ruby-forum.com/t/charset-problems-with-partials/107526 "2007-06-22T16:27:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [June 22, 2007, 4:27pm UTC](https://www.ruby-forum.com/t/charset-problems-with-partials/107526/1 "2007-06-22T16:27:43Z")

</div>

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! 🙂

–  
Regards,  
Martin S.

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [June 13, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/charset-problems-with-partials/107526/2 "2008-06-13T16:09:12Z")

</div>

I have exactly the same problem, Martin.

Did you find out a way to solve this?

Thanks!
