On Wed, Apr 12, 2006 at 02:29:50AM +0900, Ben R. wrote:
I am using the Ruby Vpim library to create Vcards. I am having
trouble getting my address entries to format correctly when the
resulting VCF file is loaded into an address book. Is there a special
character to create a break line in the address field? Many of the
addresses in my data include multiple line addresses and they are
being forced into one line.
Lets move this conversation over to vpim-talk, so we don’t take up the
attention of the entire ruby world.
Here’s an example of encoding a multiline street with vpim-0.360:
% cat ex_multiline.rb
card = Vpim::Vcard::Maker.make2 do |maker|
maker.add_name do |name|
name.prefix = ‘Dr.’
name.given = ‘Jimmy’
name.family = ‘Death’
maker.add_addr do |addr|
addr.preferred = true
addr.location = ‘work’
addr.street = “12 Last Row,\n13th Section”
addr.locality = ‘City of Lost Children’
addr.country = ‘Cinema’
card = Vpim::Vcard.decode(card.to_s).first
% ruby -I …/lib -w ex_multiline.rb
FN:Dr. Jimmy Death
ADR;TYPE=work,pref:;;12 Last Row,\n13th Section;City of Lost
12 Last Row,
So, I think it works.
If a card encoded like this doesn’t import correctly into your address
app, I’d like to see a card exported from your address book program that
newlines in the address fields, to see how it thinks things should be
Also, the code you use to encode the address and the version of Vpim you
using would be helpful, and an example of a card you’ve encoded.