From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: RE: [h-e-w] Hunsepll in Emacs - charset error for Swedish dictionary Date: Tue, 8 Apr 2014 18:24:18 +0200 Message-ID: References: <83fvln7tes.fsf@gnu.org> , <8338hn7q6m.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_43f81458-d14f-4726-b6c9-d45e5ae8cb50_" X-Trace: ger.gmane.org 1396974290 21859 80.91.229.3 (8 Apr 2014 16:24:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2014 16:24:50 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 18:24:44 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WXYpD-0007FS-8D for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2014 18:24:39 +0200 Original-Received: from localhost ([::1]:41803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYpC-0001Sr-Pj for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2014 12:24:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYp4-0001Ka-2g for emacs-devel@gnu.org; Tue, 08 Apr 2014 12:24:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXYoy-0001pD-TB for emacs-devel@gnu.org; Tue, 08 Apr 2014 12:24:29 -0400 Original-Received: from blu0-omc2-s2.blu0.hotmail.com ([65.55.111.77]:39111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYot-0001oI-DH; Tue, 08 Apr 2014 12:24:19 -0400 Original-Received: from BLU183-W13 ([65.55.111.72]) by blu0-omc2-s2.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 8 Apr 2014 09:24:18 -0700 X-TMN: [0ld4RbOwOiA6b3exwnvY51QzHx9GYjwM] X-Originating-Email: [arthur.miller@live.com] Importance: Normal In-Reply-To: <8338hn7q6m.fsf@gnu.org> X-OriginalArrivalTime: 08 Apr 2014 16:24:18.0827 (UTC) FILETIME=[FDD255B0:01CF5346] X-detected-operating-system: by eggs.gnu.org: Windows XP X-Received-From: 65.55.111.77 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171344 Archived-At: --_43f81458-d14f-4726-b6c9-d45e5ae8cb50_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Date: Tue=2C 8 Apr 2014 19:15:45 +0300 > From: eliz@gnu.org > Subject: Re: [h-e-w] Hunsepll in Emacs - charset error for Swedish dictio= nary > To: arthur.miller@live.com > CC: help-emacs-windows@gnu.org >=20 > > From: arthur miller > > Date: Tue=2C 8 Apr 2014 17:20:06 +0200 > > Cc: "help-emacs-windows@gnu.org" > >=20 > > > Try using utf-8 instead of iso-8859-1. I don't think the encoding of > > > the dictionary matters (hunspell will convert if needed). You should > > > try using utf-8 with hunspell by default. > > >=20 > >=20 > > I did! Before I posted - I used email-lists as a last resort. > >=20 > > I have tryed with utf-8 everywhere where it could matter=2C and I have = also tryed > > iso-8859-1-dos . I have try to instruct Emacs to use for LANG as in sv_= SE.iso8859-1-dos=2C > > and so on. > >=20 > > I have just tryed it again - it does no changes at all. Here are settin= g I used with utf-8 instead: > >=20 > > (after 'ispell > > (message "loading spellchecker") > > (defvar *load-start* (current-time)) > > (defun anarcat/time-to-ms (time) > > (+ (* (+ (* (car time) (expt 2 16)) (car (cdr time))) 1000000) (car= (cdr (cdr time))))) > >=20 > > (add-to-list 'ispell-dictionary-alist '(("svenska" > > "[A-Z=D6=C4=C5a-z=F6=E4=E5]" > > "[^A-Z=D6=C4=C5a-z=F6=E4=E5]" > > "[']" > > nil > > ("-d" "sv_SE") > > t > > utf-8) > > ("svenska8" > > "[A-Z=D6=C4=C5a-z=F6=E4=E5]" > > "[^A-Z=D6=C4=C5a-z=F6=E4=E5]" > > "[']" > > nil > > ("-B" "-d" "sv_SE") > > t > > utf-8) > > ("english" > > "[[:alpha:]]" > > "[^[:alpha:]]" > > "[']" > > t > > ("-d" "en_US") > > nil > > utf-8))) > >=20 > > (setq ispell-local-dictionary-alist ispell-dictionary-alist) > > (setq ispell-hunspell-dictionary-alist ispell-dictionary-alist) > > (setq ispell-dictionary "english") > > (setq-default ispell-program-name "hunspell") > > (setq ispell-extra-args '("-i" "utf-8")) > > (global-set-key (kbd "C-c d") 'switch-dictionary-sv-en)) > >=20 > > And settings for Emacs to use utf-8 > >=20 > > (set-language-environment 'utf-8) > > (setq locale-coding-system 'utf-8) > > (set-default-coding-systems 'utf-8) > > (set-terminal-coding-system 'utf-8) > > (set-selection-coding-system 'utf-8) > > (prefer-coding-system 'utf-8) > >=20 > > > (Btw: where did you get that Swedish dictionary?) > >=20 > > Files are from OpenOffice repository: http://archive.services.openoffic= e.org/pub/mirror/OpenOffice.org/contrib/dictionaries/ >=20 > Please try with Emacs 24.3 first. With that version=2C I succeed in > using the Swedish dictionary above by doing the following: >=20 > emacs -Q > (setq ispell-program-name > (locate-file "hunspell" exec-path exec-suffixes 'file-executable-p)= ) > (setq > ispell-local-dictionary-alist > '(("svenska" > "[A-Z=D6=C4=C5a-z=F6=E4=E5]" > "[^A-Z=D6=C4=C5a-z=F6=E4=E5]" > "[']" > nil > ("-d" "sv_SE") > t > utf-8))) >=20 > C-x h > M-x eval-region RET > M-x ispell-change-dictionary RET svenska RET >=20 > Now go to some word in the buffer and type M-$. You should see > suggestions for correcting the "typo". >=20 > The above assumes hunspell.exe is on PATH. If it isn't=2C modify the > first setq to specify a full absolute file name of hunspell.exe. >=20 > If the above doesn't work for you=2C then please try the hunspell.exe > binaries from the ezwinports site. When I ported Hunspell to Windows=2C > I fixed several bugs in it=3B it is possible that the sources you > compiled don't include those fixes=2C in which case the problems you see > are expected. Yepp=2C you are right. I haven't fixed any bugz in Hunspell=2C I have just = compiled it. Actually one small configuration thing just to get it to compile. I have tested now my own hu= nspell.exe and -Q options=2C but neither of Emacses works=2C but with your Hunsepll both do=2C so it must pa= tches you have applied. Once again - thanks for pointing me to ezwinport. best regards /a = --_43f81458-d14f-4726-b6c9-d45e5ae8cb50_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


>=3B Date: Tue=2C= 8 Apr 2014 19:15:45 +0300
>=3B From: eliz@gnu.org
>=3B Subject: = Re: [h-e-w] Hunsepll in Emacs - charset error for Swedish dictionary
>= =3B To: arthur.miller@live.com
>=3B CC: help-emacs-windows@gnu.org
= >=3B
>=3B >=3B From: arthur miller <=3Barthur.miller@live.com&g= t=3B
>=3B >=3B Date: Tue=2C 8 Apr 2014 17:20:06 +0200
>=3B >= =3B Cc: "help-emacs-windows@gnu.org" <=3Bhelp-emacs-windows@gnu.org>=3B=
>=3B >=3B
>=3B >=3B >=3B Try using utf-8 instead of iso-8= 859-1. I don't think the encoding of
>=3B >=3B >=3B the dictionar= y matters (hunspell will convert if needed). You should
>=3B >=3B &= gt=3B try using utf-8 with hunspell by default.
>=3B >=3B >=3B >=3B >=3B
>=3B >=3B I did! Before I posted - I used email-list= s as a last resort.
>=3B >=3B
>=3B >=3B I have tryed with ut= f-8 everywhere where it could matter=2C and I have also tryed
>=3B >= =3B iso-8859-1-dos . I have try to instruct Emacs to use for LANG as in sv_= SE.iso8859-1-dos=2C
>=3B >=3B and so on.
>=3B >=3B
>=3B= >=3B I have just tryed it again - it does no changes at all. Here are se= tting I used with utf-8 instead:
>=3B >=3B
>=3B >=3B (after = 'ispell
>=3B >=3B (message "loading spellchecker")
>=3B >= =3B (defvar *load-start* (current-time))
>=3B >=3B (defun anarca= t/time-to-ms (time)
>=3B >=3B (+ (* (+ (* (car time) (expt 2 16)= ) (car (cdr time))) 1000000) (car (cdr (cdr time)))))
>=3B >=3B
= >=3B >=3B (add-to-list 'ispell-dictionary-alist '(("svenska"
>= =3B >=3B "[A-Z=D6=C4=C5a-z=F6=E4=E5]"
>=3B &g= t=3B "[^A-Z=D6=C4=C5a-z=F6=E4=E5]"
>=3B >=3B = "[']"
>=3B >=3B nil>=3B >=3B ("-d" "sv_SE")
>=3B >=3B = t
>=3B >=3B utf-8)
>= =3B >=3B ("svenska8"
>=3B >=3B = "[A-Z=D6=C4=C5a-z=F6=E4=E5]"
>=3B >=3B = "[^A-Z=D6=C4=C5a-z=F6=E4=E5]"
>=3B >=3B "= [']"
>=3B >=3B nil
>=3B >=3B = ("-B" "-d" "sv_SE")
>=3B >=3B t=
>=3B >=3B utf-8)
>=3B >=3B = ("english"
>=3B >=3B "[[:alpha:]]= "
>=3B >=3B "[^[:alpha:]]"
>=3B >=3B = "[']"
>=3B >=3B t
&g= t=3B >=3B ("-d" "en_US")
>=3B >=3B = nil
>=3B >=3B utf-8)))
>= =3B >=3B
>=3B >=3B (setq ispell-local-dictionary-alist ispell-d= ictionary-alist)
>=3B >=3B (setq ispell-hunspell-dictionary-alist = ispell-dictionary-alist)
>=3B >=3B (setq ispell-dictionary "englis= h")
>=3B >=3B (setq-default ispell-program-name "hunspell")
>= =3B >=3B (setq ispell-extra-args '("-i" "utf-8"))
>=3B >=3B (g= lobal-set-key (kbd "C-c d") 'switch-dictionary-sv-en))
>=3B >=3B >=3B >=3B And settings for Emacs to use utf-8
>=3B >=3B
>= =3B >=3B (set-language-environment 'utf-8)
>=3B >=3B (setq locale-= coding-system 'utf-8)
>=3B >=3B (set-default-coding-systems 'utf-8)<= br>>=3B >=3B (set-terminal-coding-system 'utf-8)
>=3B >=3B (set-= selection-coding-system 'utf-8)
>=3B >=3B (prefer-coding-system 'utf= -8)
>=3B >=3B
>=3B >=3B >=3B (Btw: where did you get that = Swedish dictionary?)
>=3B >=3B
>=3B >=3B Files are from Open= Office repository: http://archive.services.openoffice.org/pub/mirror/OpenOf= fice.org/contrib/dictionaries/
>=3B
>=3B Please try with Emacs 2= 4.3 first. With that version=2C I succeed in
>=3B using the Swedish d= ictionary above by doing the following:
>=3B
>=3B emacs -Q
= >=3B (setq ispell-program-name
>=3B (locate-file "hunspell" = exec-path exec-suffixes 'file-executable-p))
>=3B (setq
>=3B = ispell-local-dictionary-alist
>=3B '(("svenska"
>=3B = "[A-Z=D6=C4=C5a-z=F6=E4=E5]"
>=3B "[^A-Z=D6=C4=C5a-z=F6=E4=E5]"=
>=3B "[']"
>=3B nil
>=3B ("-d" "sv_SE")
>=3B = t
>=3B utf-8)))
>=3B
>=3B C-x h
>=3B M-x e= val-region RET
>=3B M-x ispell-change-dictionary RET svenska RET>=3B
>=3B Now go to some word in the buffer and type M-$. You sho= uld see
>=3B suggestions for correcting the "typo".
>=3B
>= =3B The above assumes hunspell.exe is on PATH. If it isn't=2C modify the>=3B first setq to specify a full absolute file name of hunspell.exe.>=3B
>=3B If the above doesn't work for you=2C then please try th= e hunspell.exe
>=3B binaries from the ezwinports site. When I ported = Hunspell to Windows=2C
>=3B I fixed several bugs in it=3B it is possib= le that the sources you
>=3B compiled don't include those fixes=2C in = which case the problems you see
>=3B are expected.

Yepp=2C you = are right. I haven't fixed any bugz in Hunspell=2C I have just compiled it.= Actually one small
configuration thing just to get it to compile. = =3B I have tested now my own hunspell.exe =3B and -Q options=2C but
= neither of Emacses works=2C but with your Hunsepll both do=2C so it must pa= tches you have applied.

Once again - thanks for pointing me to ezwin= port.

best regards
/a
= --_43f81458-d14f-4726-b6c9-d45e5ae8cb50_--