Results 1 to 4 of 4
Thread: Rakefile help
Nov 18, 2011, 18:05 #1
I'm hoping someone can help me out here.
I haven't got my application online so will explain as best as I can.
I have written a rake task to import specific data from a CSV file into my database.
It was working perfectly, however I was tweaking the .numbers file (which I then export out to CSV using UTF-8 encoding) and I changed the word "Disneys" to "Disney's" to make it correct.
However, the rakefile keeps choking on the quote.
It seems like it's has incorrectly identified the encoding type of the CSV file.
The error I receive is something along the lines of:
Encoding::UndefinedConversionError: "\xE2" from ASCII-8BIT to UTF-8: INSERT INTO "parks" ("city", "country", "created_at", "lat", "lng", "name", "region", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?
What confuses me is that I have other locations in my file where I have used quotes and it doesn't choke on those but if I remove one of those passing quotes and re-insert a new quote, it starts to choke on the new one as well.
I have tried adding # coding: utf-8 to the top of the rakefile but that doesn't solve the issue.
Anyone have any ideas?
Nov 19, 2011, 12:19 #2
Dec 29, 2011, 15:27 #3
- Join Date
- May 2006
- Central Florida
- 180 Post(s)
- 4 Thread(s)
Since you indicated you changed the quote mark, I suspect the others (that were not offending RAKE) actually have "ticks" and not single quotes. The difference is so subtle it is difficult to detect visually.
Dec 30, 2011, 06:28 #4
Appreciate the reply.
I did eventually manage to get this solved. I disabled Magic Quotes in Pages preferences and then did a find and replace to put proper quotes in, all works perfectly now.
Thanks once again though.