This is all I get:

PDOException: in drupal_write_record() (line 6859 of /Users/rory/Sites/ppc_dev/includes/common.inc

It does this with batch import on or off. If I take the records individually and paste them into the RIS field, it works fine.

Attached is the file that I'm using that causes the error.

CommentFileSizeAuthor
#1 transportation.txt20.23 KBrjerome
transportation.txt19.93 KBrory_o

Comments

rjerome’s picture

StatusFileSize
new20.23 KB

The problem is the file is not in UTF-8 format.

I've attached the same file, saved inn UTF-8 format and it works fine.

rory_o’s picture

Status: Active » Closed (works as designed)

Oh snap, things got all messed up when going from one export translating to another to another to another... Biblio is solving all of this though, so thank you and thank you for the fast responses!

pheraph’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc3
Status: Closed (works as designed) » Needs review

Would it be possible to check if the import-file is utf8 and if not show a message that helps the user to import its data instead of showing a cryptic message? This would be a helpful addition. Besides that: Biblio is an awesome module, thanks for it!

Raphael

rjerome’s picture

I'll look into that (and perhaps automatically converting the file).

Ron.

daggar’s picture

#3 described my problem. PHP's utf8_encode function fixed it. Thanks Pheraph.

rjerome’s picture

utf8_encode will work fine -- assuming the file/string is not already utf8 encoded AND it's ISO-8859-1, if it is already utf8 or some other character set, then you will likely end up with garbage. The trick is determining the format of the incoming data and appropriately converting it to utf8.

There are ways to do this at both the file level and the string level, but I just haven't had time to do it yet :(

Ron.

liam morland’s picture

Version: 7.x-1.0-rc3 » 7.x-1.x-dev
Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Active