Re: Fwd: bbdb kanji being corrupped on save

2012-07-05 Thread Randy Bush
 when i have kanji in a name and then save the .bbdb, i end up with \mush
 in the file and lose the kanji.  i tried saving in mule,
 iso-this-and-that, etc.  no love.  same problem for extended latin
 alphabets.
 
 BBDB has gone through a major rewrite to bring the code up-to-date.
 (For me, it works fine with chinese characters. Haven't tried kanji yet.)
 
 Currently BBDB 3 does not support wanderlust. But it is possibly
 easier to add sypport for wanderlust to BBDB 3 than trying to fix
 problems with kanji characters in bbdb 2.35.

thanks to Yamamoto Taku wavekid...@gmail.com

--- /cygdrive/c/Users/taku/Downloads/bbdb-2.35/lisp/bbdb.el
2007-01-02 17:01:18.0 +0900
+++ /usr/local/share/emacs/23.4/site-lisp/bbdb/bbdb.el  2010-01-09
21:01:05.0 +0900
@@ -761,8 +761,8 @@
 ;; emacs-mule would be better) with both Emacs 21 and XEmacs.
 (defconst bbdb-file-coding-system
   (if (fboundp 'coding-system-p)
-  (cond ((coding-system-p 'utf-8-emacs)
- 'utf-8-emacs)
+  (cond ((coding-system-p 'utf-8-unix)
+ 'utf-8-unix)
 (t 'iso-2022-7bit)))
   Coding system used for reading and writing `bbdb-file'.
 This should not be changed by users.)

randy

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: Fwd: bbdb kanji being corrupped on save

2012-07-03 Thread Roland Winkler
On Sun Jul 1 2012 Randy Bush wrote:
 13 mba (and various other platforms)
 macos 10.7.4
 emacs i386-apple-darwin9.8.0, Carbon Version 1.6.0
 wanderlust 2.15.9
 bbdb 2.35
 
 when i have kanji in a name and then save the .bbdb, i end up with \mush
 in the file and lose the kanji.  i tried saving in mule,
 iso-this-and-that, etc.  no love.  same problem for extended latin
 alphabets.

BBDB has gone through a major rewrite to bring the code up-to-date.
(For me, it works fine with chinese characters. Haven't tried kanji yet.)

Currently BBDB 3 does not support wanderlust. But it is possibly
easier to add sypport for wanderlust to BBDB 3 than trying to fix
problems with kanji characters in bbdb 2.35.

Roland


BBDB is available at
http://savannah.nongnu.org/projects/bbdb/
To check it out, use
git clone git://git.savannah.nongnu.org/bbdb.git

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Fwd: bbdb kanji being corrupped on save

2012-07-01 Thread Randy Bush
13 mba (and various other platforms)
macos 10.7.4
emacs i386-apple-darwin9.8.0, Carbon Version 1.6.0
wanderlust 2.15.9
bbdb 2.35

when i have kanji in a name and then save the .bbdb, i end up with \mush
in the file and lose the kanji.  i tried saving in mule,
iso-this-and-that, etc.  no love.  same problem for extended latin
alphabets.

it is likely my fault, as i seem to have accumulated an amazing amount
of bbdb cruft.

randy

(require 'bbdb-wl)
(bbdb-wl-setup)
;; enable pop-ups
(setq bbdb-use-pop-up nil)
;; auto collection
(setq bbdb/mail-auto-create-p nil)
;; exceptional folders against auto collection
(setq bbdb-wl-ignore-folder-regexp ^@)
(setq signature-use-bbdb t)
(setq bbdb-north-american-phone-numbers-p nil)
;; shows the name of bbdb in the summary :-)
(setq wl-summary-from-function 'bbdb-wl-from-func)
;; print full names as much as possible
(setq bbdb-dwim-net-address-allow-redundancy t)

;; bbdb gather from message send addresses
(defun zzz-bbdb-mail-send-function ()
  (bbdb-update-records
   (delete-if (lambda (item)
(string=  (caaddr item)))
  (bbdb-wl-get-addresses bbdb-get-only-first-address-p))
   t t))
(add-hook 'mail-send-hook 'zzz-bbdb-mail-send-function)

; canonicalize bbdb names
; Len Trigg lenbok+mlb...@gmail.com
(defun zzz-bbdb-canonicalize-name-hook (name)
  Function used to canonicalize the full names of bbdb entries.
  (cond
;; strip extra quotes (Some MS mailer likes 'full name')
((string-match \\`[`'\]\\(.*\\)[`'\]\\' name)
 (bbdb-match-substring name 1))
;; replace multiple whitespace with single
((string-match [ \f\t\n\r\v]\\{2,\\} name)
 (replace-match   nil t name))
;; remove anything in round brackets, e.g.: Firstname Surname (E-mail)
((string-match [ ]+(.*) name)
 (replace-match  nil t name))
;; strip leading whitespace (this is a bug in std11 libs?)
((string-match \\`[ \t]+\\(.*\\) name)
 (bbdb-match-substring name 1))
;; strip trailing whitespace
((string-match \\(.*\\)[ ]+\\' name)
 (bbdb-match-substring name 1))
;; strip Dr pronoun
((string-match \\`Dr\\.? \\(.*\\) name)
 (bbdb-match-substring name 1))
;; person and person - person  person
((string-match \\`\\(\\w+\\) and \\(\\w.+\\)\\' name)
 (concat (bbdb-match-substring name 1)(bbdb-match-substring name 2)))
;; Surname, Firstname - Firstname Surname
((string-match \\`\\(\\w.+\\), \\(\\w.+\\)\\' name)
 (concat (bbdb-match-substring name 2)   (bbdb-match-substring name 1)))
;; replace name without any whitespace with empty; I don't want bbdb names 
containing only a single name
((string-match \\`\\(\\w+\\)\\' name)
 ;;(message (format Eliding name %s name))
 )
(t name)))

;; make bbdb-wl-canonicalize-full-name-function behave like
;; bbdb-canonicalize-net-hook. (much more useful, imo)
(defun zzz-bbdb-canonicalize-name (name)
  (when name;name is sometimes nil?
(while (not (eq name (setq name (zzz-bbdb-canonicalize-name-hook name
  ;;(insert-string (concat name \n))
))
  name)

(setq bbdb-wl-canonicalize-full-name-function 'zzz-bbdb-canonicalize-name)

randy

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/