From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: how to sanitize org-protocol text ? Date: Fri, 10 Apr 2015 10:32:28 +0200 Message-ID: References: <5525358C.6040005@gmail.com> <871tjuq8p5.fsf@turing.flintfam.org> <55277BC4.9070501@gmail.com> Reply-To: fabrice.popineau@centralesupelec.fr Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01182362f7e92a05135a9b24 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgUN7-0006Mj-BE for emacs-orgmode@gnu.org; Fri, 10 Apr 2015 04:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgUN3-0004X8-SE for emacs-orgmode@gnu.org; Fri, 10 Apr 2015 04:33:05 -0400 Received: from smtp2.supelec.fr ([160.228.120.31]:60385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgUN3-0004W7-GR for emacs-orgmode@gnu.org; Fri, 10 Apr 2015 04:33:01 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp2.supelec.fr (Postfix) with ESMTP id 5E6168011B for ; Fri, 10 Apr 2015 10:32:50 +0200 (CEST) Received: from smtp2.supelec.fr ([127.0.0.1]) by localhost (smtp2.supelec.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xKuZVeEedRW7 for ; Fri, 10 Apr 2015 10:32:50 +0200 (CEST) Received: from mail-vn0-f41.google.com (mail-vn0-f41.google.com [209.85.216.41]) by smtp2.supelec.fr (Postfix) with ESMTPSA id 592CF8019C for ; Fri, 10 Apr 2015 10:32:49 +0200 (CEST) Received: by vnbg62 with SMTP id g62so3828283vnb.7 for ; Fri, 10 Apr 2015 01:32:48 -0700 (PDT) In-Reply-To: <55277BC4.9070501@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sander Boer Cc: "emacs-orgmode@gnu.org" , "Samuel W. Flint" --089e01182362f7e92a05135a9b24 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I don't seem to have a problem under Win8.1 (but honnestly, Win7 shouldn't make any difference). I'm using Chrome. I have ;; Character encodings default to utf-8. (set-language-environment "UTF-8") (prefer-coding-system 'utf-8) (set-language-environment 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-selection-coding-system 'utf-8) ;; MS Windows clipboard is UTF-16LE (set-clipboard-coding-system 'utf-16le-dos) in my emacs init files. Try with these settings, and see if it still fails (restart emacs). If it fails only on some web pages, please post a link. Fabrice 2015-04-10 9:29 GMT+02:00 Sander Boer : > Hi Samuel, > > thank you for replying. > Yes I am on windows 7, I forgot to mention that. I have not tested this > behavior on win 8 yet. > > winhate.Add("Ah windows, a deep well of sorrow and disappointment (maildi= r > on win anyone?).") > > Anyway, > > selection-coding-system : utf-8 > current-language-environment: Dutch > file-name-coding-system: nil > default-file-name-coding-system: utf-8 > w32-unicode-filenames: t > > I was under the impression that setting all the file codings to unicode > would remove conding issues, but judging from the amount of posts of Xah > Lee on the subject I think I should know better. > > gr. > S > > On 9-4-2015 5:31, Samuel W. Flint wrote: > >> Sander Boer writes: >> >> Hi, >>> >>> I just set up org-protocol and it works fine. However, when I have >>> text selected to have it end up in the body of the new note I get >>> presented with two problems: >>> >>> - Every linebreak has a trailing ^M, this does not happen when I paste >>> the text. >>> >> Are you on Windows? >> >> - Unicode quote symbols ? The text is speckled with \222 ("there=E2=80= =99s" >>> becomes "there\222s") or \221 (=E2=80=98quote=E2=80=99 becomes \221qu= ote\222) >>> >> Again, are you on Windows? >> >> Is there a solution ? >>> >> What are the values of the following? >> - selection-coding-system >> - current-language-environment >> - file-name-coding-system >> >> gr >>> S >>> >>> >>> HTH, >> >> Sam >> >> -- >> Samuel W. Flint >> swflint@flintfam.org (402) 517-8468 >> freenode: swflint >> http://flintfam.org/~swflint >> 4096R/266596F4 >> (9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4) >> "The most dangerous phrase in the language is, 'We've always done it >> this way'." -- Grace Hopper >> > > > --=20 Fabrice Popineau ----------------------------- SUPELEC D=C3=A9partement Informatique 3, rue Joliot Curie 91192 Gif/Yvette Cedex Tel direct : +33 (0) 169851950 Standard : +33 (0) 169851212 ------------------------------ --089e01182362f7e92a05135a9b24 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I don't seem to have a problem = under Win8.1 (but honnestly, Win7 shouldn't make any difference).
=
I'm using Chrome.
I have

;= ; Character encodings default to utf-8.
(set-language-environment= "UTF-8")
(prefer-coding-system 'utf-8)
(= set-language-environment 'utf-8)
(set-default-coding-systems = 'utf-8)
(set-terminal-coding-system 'utf-8)
(se= t-selection-coding-system 'utf-8)
;; MS Windows cl= ipboard is UTF-16LE
(set-clipboard-coding-system 'utf-16le-do= s)

in my emacs init files.

Try with these settings, and see if it still fails (restart emacs).=
If it fails only on some web pages, please post a link.

Fabrice

2015-04-10 9:29 GMT+02:00 Sander Boer = <sanboer@gmail.co= m>:
Hi Samuel,

thank you for replying.
Yes I am on windows 7, I forgot to mention that. I have not tested this beh= avior on win 8 yet.

winhate.Add("Ah windows, a deep well of sorrow and disappointment (mai= ldir on win anyone?).")

Anyway,

selection-coding-system : utf-8
current-language-environment: Dutch
file-name-coding-system: nil
default-file-name-coding-system: utf-8
w32-unicode-filenames: t

I was under the impression that setting all the file codings to unicode wou= ld remove conding issues, but judging from the amount of posts of Xah Lee o= n the subject I think I should know better.

gr.
S

On 9-4-2015 5:31, Samuel W. Flint wrote:
Sander Boer <sanb= oer@gmail.com> writes:

Hi,

I just set up org-protocol and it works fine. However, when I have
text selected to have it end up in the body of the new note I get
presented with two problems:

- Every linebreak has a trailing ^M, this does not happen when I paste
the text.
Are you on Windows?

- Unicode quote symbols ? The text is speckled with \222 ("there=E2=80= =99s"
becomes "there\222s")=C2=A0 or \221=C2=A0 (=E2=80=98quote=E2=80= =99 becomes \221quote\222)
Again, are you on Windows?

Is there a solution ?
What are the values of the following?
=C2=A0 - selection-coding-system
=C2=A0 - current-language-environment
=C2=A0 - file-name-coding-system

gr
S


HTH,

Sam

--
Samuel W. Flint
swflint@flintfam.= org=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (402)= 517-8468=C2=A0 =C2=A0 =C2=A0 <XMPP>
freenode: swflint
http://flintfam.= org/~swflint
4096R/266596F4
=C2=A0 =C2=A0 =C2=A0 =C2=A0(9477 D23E 389E 40C5 2F10=C2=A0 DE19 68E5 318E 2= 665 96F4)
"The most dangerous phrase in the language is, 'We've always d= one it
this way'."=C2=A0 -- Grace Hopper





--
Fabrice Popineau
-----------------------------
SUPELEC
D=C3=A9partement Informatique
3, rue Jol= iot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 1= 69851950
Standard : +33 (0) 169851212
-----------------= -------------

--089e01182362f7e92a05135a9b24--