pinoaffe / org-vcard

Export and import vCards from within GNU Emacs' Org mode.
61 stars 7 forks source link

Create utf-8 buffers when exporting to vcard 4.0 #10

Closed sg2002 closed 10 years ago

sg2002 commented 10 years ago

Just tried exporting to vcard.

The problem is when you export to a buffer, the buffer contents though they are encoded in utf-8, are not determined as such by emacs. If you try exporting my earlier vcard back, you would see that the Cyrillic letters are not shown properly in the export buffer.

flexibeast commented 10 years ago

i just tried:

It didn't work at all for me. i checked the value of buffer-file-coding-system for the *org-vcard-import* buffer; it was set to utf-8-unix. Toggling debug-on-error produces a backtrace which begins:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  org-agenda-skip() [snip]
  org-scan-tags [snip]
  org-map-entries [snip]
flexibeast commented 10 years ago

So, having now made sure org-mode is enabled for the *org-vcard-import* buffer, i can see the output is indeed not encoded correctly; describe-char reports the erroneous output as having a preferred-charset of "eight-bit". Yet buffer-file-coding-system reports the buffer as utf-8-unix.

i'll start looking into the behaviour of the org-vcard-export-line function, which is where encoding as UTF-8 is supposed to be happening.

flexibeast commented 10 years ago

i've made a change such that exporting your example vCard data produces a buffer with the output correctly encoded; could you please verify that it works for you also?

sg2002 commented 10 years ago

Yep, works now.

flexibeast commented 10 years ago

Thanks!