When I insert certain strings coming in from API calls into my db, they get cut off at certain characters. This is with ruby 1.8.7. I have everything set to utf8 app-wide and in MySQL. I typically don't have any problem entering utf8 content into the DB in other parts of the app.
It's supposed to be "El Soldado y La Muñeca". If I insert it into the db, only this makes it in: "11 El Soldado y La Mu".
>> name => "11 El Soldado y La Mu?eca(1).mp3" >> name[20..20] => "u" >> name[21..21] => "\361" >> name[22..22] => "e"
- is that a utf8 character?
- i know that ruby 1.8 isn't encoding aware, but to be honest i always forget how this should affect me -- i always just set everything at all the other layers to utf8 and everything is fine. WHY THIS NO WORK NOW?
update
CORRECTION-- i was wrong, it's not coming from the api, it's coming from the file system.
the wrongly-encoded character is coming from inside the house!
new question: How can I get utf8 characters from File#path