SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Rakefile help

  1. #1
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Rakefile help

    Hello all,

    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?

    Thankyou

    Regards,
    Neil

  2. #2
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,336
    Mentioned
    192 Post(s)
    Tagged
    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.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  4. #4
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Regards,
    Neil


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •