0

I did not mention encoding in my database.yml file.And now after parsing a site,a lot of data is saved with special characters.

Is there a way to change or set the encoding to utf-8 now?And what is the best way to do it,would really appreciate if you can explain it with little snippets of code.

Or do I need to do the parsing again.

3
  • Doing the parsing again with the correct encoding specified would probably be the easiest way. Commented Nov 4, 2011 at 8:30
  • ya but it would take hours again,so if there is another way i would really prefer that Commented Nov 4, 2011 at 8:33
  • You'll need to show how your characters are broken exactly Commented Nov 4, 2011 at 8:33

1 Answer 1

1

No, it is not possible to do it without reconfiguring configurations and fixing existing data. Else, you will end up corrupting your db (some data in one encoding and some in another)

This should help:

  1. converting-your-rails-app-to-utf8
  2. configure-rails-and-mysql-to-support-utf-8
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.