Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

SQLite chokes on certain characters #33

Open
rgrove opened this issue Jun 2, 2010 · 4 comments
Open

SQLite chokes on certain characters #33

rgrove opened this issue Jun 2, 2010 · 4 comments

Comments

@rgrove
Copy link
Owner

rgrove commented Jun 2, 2010

Reported on the mailing list at http://groups.google.com/group/larch/browse_thread/thread/1dd363a5be6f4ad0?hl=en:

I'm using larch to perform a large migration of a client's Google Apps
account with about 100k emails and a couple hundred labels. Everything went
well until larch started with the following Gmail label (font size increased
to notice the apostrophe): "Teddy’s Bike"

Note the apostrophe, it's not your regular ' apostrophe, it's a different
one:

I believe the problem lies in the weird apostrophe, because I had no trouble
with other labels which had the regular apostrophe. I logged larch's output
with the insane option:

S: RUBY0150 OK Success^M 
[17:19:28] [info] imap.gmail.com/Teddy<E2><80><99>s Bike -> imap.gmail.com/Denny<E2><80><99>s Hawthorne 
[17:19:28] [debug] [<] Teddy<E2><80><99>s Bike: getting mailbox status 
C: RUBY0163 STATUS "Teddy&IBk-s Bike" (MESSAGES UIDNEXT UIDVALIDITY)^M 
S: * STATUS "Teddy&IBk-s Bike" (MESSAGES 167 UIDNEXT 170 UIDVALIDITY 607519705)^M 
S: RUBY0163 OK Success^M 
[17:19:28] [fatal] Attempt to update object did not result in a single row modification (SQL: UPDATE `mailboxes` SET `uidvalidity` = 607519705 WHERE (`id` = 62)) 
[17:19:28] [info] 0 message(s) copied, 0 failed, 0 deleted out of 7507 total 
[17:19:28] [debug] performing database maintenance
@tester22
Copy link

I have the same problem but in my case it is Swedish characters åäö in folder names.

Here the folder on the local Exchange 2003 server has the name "Sparade Mail/Server, nätverk &-datauppgifter"

[20:27:23] [info] localhost/INBOX/Sparade Mail/Server, n&AOQ-tverk &- datauppgif
ter -> imap.gmail.com/INBOX/Sparade Mail/Server, n&AOQ-tverk &- datauppgifter
[20:27:23] [error] unable to get status of mailbox: The requested item could not
be found.

@tester22
Copy link

a workaround is to replace this line in lib/larch/imap/mailbox.rb:
@name_utf7 = Net::IMAP.encode_utf7(@name)
with:
@name_utf7 = @name

The only drawback seems to be that the folder are added twice to the target server one time with correct name and one time with unencoded characters eg: &AOQ-

@enc
Copy link

enc commented May 3, 2011

I have the same problem with kyrillic letters. Easy reproducible.

@carloscabanero
Copy link

This is an upstream bug with amalgalite. You can fix it by changing Sequel to Sqlite3 again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants