I''ve got two issues: First, it seems that every time there''s a comma in a street field, it gets preceded by a ''\''. I can''t seem to get rid of it, or even find where it''s being generated. (ex: 71229 30nd Ave NW\, Apt 50) Second, every now and then my country ''United States'' gets cut off, as if it''s reached a character limit. Has anyone experienced these problems before and know what might be causing them or how to fix them? Thank you, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20090212/2297ca6c/attachment.html>
On Thu, Feb 12, 2009 at 9:53 AM, Jason Brinton <jbrinton at whitepages.com> wrote:> I''ve got two issues: > > First, it seems that every time there''s a comma in a street field, it gets > preceded by a ''\''. I can''t seem to get rid of it, or even find where it''s > being generated. (ex: 71229 30nd Ave NW\, Apt 50) > > Second, every now and then my country ''United States'' gets cut off, as if > it''s reached a character limit.If you send me runnable ruby code that demonstrates this, I''ll take a look. Sam
On Fri, Feb 13, 2009 at 12:06 PM, Jason Brinton <jbrinton at whitepages.com> wrote:> Here''s the code I''m working with; I''ve added placeholders where we''d normally get our data out of the database, but the same problems occur even with the placeholder data. > > I''m new to Ruby, so any help would be appreciated.I''d like to help you out, but I''m doing this for free, you have to help me out a bit. I don''t have the time to rewrite your code. If you send me a ruby file, that I can run (ruby yourfile.rb), and you tell me what the problem with it is, I can probably see pretty much instantly what the problem is, and help you out. Cheers, Sam Btw, I''ve never seen anybody send code as a word document. I''d suggest not doing that.
Hey Jason, so what''s the problem with the output? I get a card that looks like this: ----------- BEGIN:VCARD VERSION:3.0 N:Paul;Arnie;;; FN:Arnie Paul ADR;TYPE=home:;;7222 31st ave se\, apt 42;Seattle;WA;98000;United States of America TEL;TYPE=home,pref:2065551212 END:VCARD ----------- This is correct. The "," character in the street address is escaped because if it wasn''t it would become a multi-part street address, which I''ve never seen an example of. If you used a ";" in the street address, or newlines, they would be escaped, too. As for the "truncation" you mentioned, perhaps whatever you are using doesn''t correctly unwrap the "continued" line? Long lines in vcard are supposed to be wrapped, with the continued line starting with a single space. I imported it into Apple''s Address Book, and it looked exactly as I''d expect after importing. Anyhow, it looks like the problem is whatever you are giving the card to. Usually there is a way of making vPim output something that will work. For example, encode the vCard with to_s(0) (or encode(0), see the docs) and it won''t wrap lines (mildly non-standard, but whatever). What software are you using, what did you see, and what did you want to see? Cheers, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/vpim-talk/attachments/20090215/26e7c280/attachment.html>
On Mon, Feb 16, 2009 at 11:38 AM, Jason Brinton <jbrinton at whitepages.com> wrote:> Thanks for the help. The to_s(0) helped with the truncation problem, and I > ended up doing a gsub of the \, pattern just before the whole card got sent > out. It feels like a bit of a hack, but it''s working.Why did you have to do that? What software fails to parse this correctly? At the least, this would help other people who have this problem. Sam