Henry Smith
2013-Mar-11 07:43 UTC
[Vpim-talk] Encoding::CompatibilityError when reading a vCard containing UTF-8 characters
Hi there, I''m having a bit of trouble using vpim with vCard files that contain UTF-8 text. Ruby throws an Encoding::CompatibilityError if I so much as call Vpim::Vcard.decode with a vCard containing just the following two lines: N:;Stra?e;;;> FN:Stra?e >Here''s the error message in full:> /var/lib/gems/1.9.1/gems/vpim-0.695/lib/vpim/vcard.rb:676:in `==='': > incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) > (Encoding::CompatibilityError) > from /var/lib/gems/1.9.1/gems/vpim-0.695/lib/vpim/vcard.rb:676:in > `decode'' > from ./test.rb:4:in `<main>'' >Am I doing something wrong? I''ve attached a vCard and short script that trigger this error, and I''ve also created a gist containing everything<https://gist.github.com/h2s/5132451>in case that''s more convenient. Thanks in advance! Henry Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20130311/27f8c6ba/attachment.html> -------------- next part -------------- BEGIN:VCARD VERSION:3.0 N:;Stra?e;;; FN:Stra?e END:VCARD -------------- next part -------------- A non-text attachment was scrubbed... Name: script.rb Type: application/octet-stream Size: 166 bytes Desc: not available URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20130311/27f8c6ba/attachment.obj> -------------- next part -------------- /var/lib/gems/1.9.1/gems/vpim-0.695/lib/vpim/vcard.rb:676:in `==='': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) (Encoding::CompatibilityError) from /var/lib/gems/1.9.1/gems/vpim-0.695/lib/vpim/vcard.rb:676:in `decode'' from ./test.rb:4:in `<main>''
Sam Roberts
2013-Mar-14 21:03 UTC
[Vpim-talk] Encoding::CompatibilityError when reading a vCard containing UTF-8 characters
Thanks for the test cases. No, you didn''t do anything wrong, I haven''t ported vpim to ruby 1.9''s String yet. I''m looking at it this week. I''ve found tons of forks on github that purport to make this work, but none that bothered to read the comment to understand what the code is supposed to do - I don''t see any signs of working code. Hopefully by next week I''ll have pushed a fix. Thanks, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20130314/99f8d6dd/attachment.html>
Henry Smith
2013-Mar-16 21:42 UTC
[Vpim-talk] Encoding::CompatibilityError when reading a vCard containing UTF-8 characters
Sweet, I''m glad this is a simple case of yet-to-be-implemented functionality. I think I''ve seen some of those forks, actually. And I even tried tinkering with vpim myself. But in the end no course of action that didn''t involve speaking to the original source of the gem made any sense at all. It''s awesome that you''re still maintaining this thing and keeping an eye on the mailing list, by the way! On Thu, Mar 14, 2013 at 9:03 PM, Sam Roberts <vieuxtech at gmail.com> wrote:> Thanks for the test cases. No, you didn''t do anything wrong, I haven''t > ported vpim to ruby 1.9''s String yet. > > I''m looking at it this week. I''ve found tons of forks on github that > purport to make this work, but none that bothered to read the comment to > understand what the code is supposed to do - I don''t see any signs of > working code. > > Hopefully by next week I''ll have pushed a fix. > > Thanks, > Sam > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20130316/81d4d3c9/attachment.html>