title: How to intentionally insert strings with the wrong encoding in Mysql?
body: <p>This is probably one of the weirdest questions that i had to ask in Stackoverflow :)</p>
  
  <p>I have a legacy, non-tested PHP application which i can't touch at all. This application uses Mysql and one database per account. So we have thousands of databases.</p>
  
  <p>Due to an error that was there way before i started working on it, this app connects with the wrong encoding in Mysql. So in database, where we were supposed to have "é" we actually get "Ã©". Although in application ( due to the wrong connection encoding ), we get é.</p>
  
  <p>I have a Rails application that manage the creation of accounts/databases. The problem is that the Rails application is using the correct encoding and when it creates the database, it will insert some data which the PHP application can't read properly.</p>
  
  <p>My question: considering that i have a string "é" in Ruby, how to i intentionally change it to "Ã©"? Any string.encode that i can use?</p>
  
  <p>Note 1: I can't dump all databases and fix this ( which would be the ideal solution ) </p>
  
  <p>Note 2: I can't switch Rails connection encoding as it uses another database which has the correct encoding</p>