# Funky character display in rails / mysql

**URL:** <https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314>\
**Category:** Rails\
**Created:** [June 28, 2006, 2:57am UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314 "2006-06-28T02:57:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 28, 2006, 2:57am UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/1 "2006-06-28T02:57:28Z")

</div>

I’m getting complaints from one of my customers that characters in their  
text are getting mangled. This happens when they paste data into my  
textboxes in rails from MS word in particluar.

Quotes are turning into question marks, etc.

Anyone have a fix / workaround for this?

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 28, 2006, 8:05pm UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/2 "2006-06-28T20:05:29Z")

</div>

Anyone…anyone?

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 28, 2006, 8:45pm UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/3 "2006-06-28T20:45:18Z")

</div>

On 28-jun-2006, at 20:00, subimage interactive wrote:

> Anyone…anyone?
> 
> On 6/27/06, subimage interactive [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
> I’m getting complaints from one of my customers that characters in  
> their text are getting mangled. This happens when they paste data  
> into my textboxes in rails from MS word in particluar.

It’s a Unicode problem, probaby multilayered. Try to switch to UTF  
for your site and database then ask your clients to paste these again.

–  
Julian ‘Julik’ Tarkhanov  
please send all personal mail to  
me at julik.nl

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 28, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/4 "2006-06-28T20:49:38Z")

</div>

> > I’m getting complaints from one of my customers that characters in their text are getting mangled. This happens when they paste data into my  
> > textboxes in rails from MS word in particluar.
> 
> It’s a Unicode problem, probaby multilayered. Try to switch to UTF for your site and database then ask your clients to paste these again.

what is the preferred way to ‘switch to UTF’ right now? ive got a site  
converted from drupal, the database hasnt been touched by ruby but it  
definitely mangles it before displaying. lots of black diamonds with  
question marks in them, and other weirdness…

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 28, 2006, 9:35pm UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/5 "2006-06-28T21:35:36Z")

</div>

Is there anyway to force string attributes to save as UTF in Ruby/Rails?

I had some foreign language characters on my blog and one of the Typo  
migrations seems to have messed them up. The database has been set to  
UTF  
the whole time, do Rails migrations not honor that or is it just a  
limitation of Ruby’s unicode (un)support?

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [June 29, 2006, 10:00am UTC](https://www.ruby-forum.com/t/funky-character-display-in-rails-mysql/96314/6 "2006-06-29T10:00:05Z")

</div>

I can’t believe nobody has run into this problem? So what’s the  
‘official’  
word on how to fix data already corrupted like this? What charset should  
we  
be using on MySQL?
