[darcs-users] [patch639] Utf-8 encoding for darcs send (reloaded)
Gabriel Kerneis
kerneis at pps.jussieu.fr
Sun Jul 17 18:57:53 UTC 2011
Hi,
this is a third attempt at using utf-8 whenever possible in darcs send.
Here is how it works:
- if mail is made of ascii characters, send with content-type charset
set to ascii and ignore locale completely,
- if mail contains invalid utf-8 characters, propose to either abort
(and save mail content in a file) or ignore the error and send with
content-type charset set to utf-8 anyway (no support for other
charset when sending),
- if mail is valid utf-8, send with content-type charset set to utf-8;
additionnally print a warning if current locale is not recognised as
utf-8 (but do not propose to abort, assuming what looks like utf-8 is
utf-8).
The warnings are respectively:
**********
Warning: darcs expects an UTF-8 encoding when sending emails.
Your text is not valid UTF-8. Send anyway? [yn]
*** and ***
Warning: sending email as UTF-8 regardless of your locale (since it seems well-formed).
**********
Please, do not hesitate to rephrase them (Darcs.Commands.Send), I am not
a native speaker. Apart from this wording issue, I tested the patch
rather extensively and I think it is ready to get into screened.
Best,
Gabriel
7 patches for repository http://darcs.net/screened:
Tue Jul 5 15:43:31 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Use utf-8 charset for darcs send in case of non-ascii characters
Fri Jul 8 17:06:44 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Add functions to get and check locale encoding in Darcs.Utils
Fri Jul 8 17:11:49 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Avoid useless re-rendering of contents message
Fri Jul 8 17:32:13 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Propose to abort before sending mail if current locale is not UTF-8
Sun Jul 17 20:35:03 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Add ByteString.isAscii
Sun Jul 17 20:35:52 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Use ByteString.isAscii in Darcs.Email
Sun Jul 17 20:36:33 CEST 2011 Gabriel Kerneis <kerneis at pps.jussieu.fr>
* Improve UI for non-ascii messages in darcs send
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 13768 bytes
Desc: Patch preview
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20110717/aeeb7c86/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-utf_8-charset-for-darcs-send-in-case-of-non_ascii-characters.dpatch
Type: application/x-darcs-patch
Size: 171361 bytes
Desc: A darcs patch for your repository!
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20110717/aeeb7c86/attachment-0003.bin>
More information about the darcs-users
mailing list