Menu

isync Merge Request #3: Now it is possible to have non ascii maildir folder names (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Georgy Kibardin wants to merge 3 commits from /u/shashurup/isync/ to master, 2022-06-20

No more cryptic UTF7 folder names! By default it is not enabled, so backward compatibility is preserved.

Commit Date  
[1f020b] (utf8-mailboxes) by Georgy Kibardin Georgy Kibardin

Print synchronization summary when progress isn't reported

2018-09-15 14:28:31 Tree
[a1657c] by Georgy Kibardin Georgy Kibardin

Code style now conforms

2018-09-15 10:31:46 Tree
[63407f] by Georgy Kibardin Georgy Kibardin

Support for UTF-8 mailbox names

There is new config parameter UseUTF8Mailboxes which tells isync to decode IMAP
mailbox names so that non ASCII names don't look cryptic anymore.

2018-08-31 12:32:59 Tree

Discussion

  • Oswald Buddenhagen

    i've been pondering this previously, and found that it would be quite some effort, because technically we need to transcode to/from whatever the system locale dictates. you just chose to use utf-8, which is probably the right choice nowadays, at least on unix, but presumably it would be a good idea to at least check whether the locale does indeed use utf-8.

    i don't know how anyone could seriously use the non-decoded names, so it seems kinda pointless to make this optional, especially as this is part of the IMAP spec itself.

    i haven't really reviewed the implementation; i'll get to it later.
    what i can already say is that the indentation and coding style in general are completely wrong.

     
  • Georgy Kibardin

    Georgy Kibardin - 2018-09-08

    Oswald Buddenhagen writes:

    i've been pondering this previously, and found that it would be quite some effort, because technically we need to transcode to/from whatever the system locale dictates. you just chose to use utf-8, which is probably the right choice nowadays, at least on unix, but presumably it would be a good idea to at least check whether the locale does indeed use utf-8.

    I've been thinking about implementing this correctly, i.e. taking into
    account system locale, however, as you mentioned, it would require to
    put some effort on this, especially identifying non-unicode encodings
    and deciding what to do with it. Also many people run it as root which
    is usually just "C" locale. So I just wanted to make it work.

    i don't know how anyone could seriously use the non-decoded names, so
    it seems kinda pointless to make this optional, especially as this is
    part of the IMAP spec itself.

    The reason to make it off by default is compatibility. I'm not sure this
    option won't break existing configuration.

    i haven't really reviewed the implementation; i'll get to it later.
    what i can already say is that the indentation and coding style in
    general are completely wrong.

    I'll take a look. I haven't done plain C for years and it looks like I
    unconsciously picked up more recent C++ habits.

     
  • Maxim

    Maxim - 2019-05-22

    Do you have a progress on the issue? It is very unconvinient to use isync with non-ascii2 folder names (e.g. cyrillic folder name).

     
  • Aurélien Rouëné

    Would very like to see this merged.

    For the locale let's put it this way, what happens if your locale don't support UTF-8, well... you get a name as cryptic as with UTF-7. But the point is nobody uses UTF-7 as a locale, but many uses UTF-8.

    UTF-8 could be the default translation target, and you could make an other translation target optional into the config file (per maildir store), as Georgy Kibardin says it would be pointless to look at the current locale as it could be different from the locale of the user.

     

    Last edit: Aurélien Rouëné 2021-01-09
  • Someone

    Someone - 2021-07-02

    Hi, just expressing my support on implementing/merging this.
    Using UTF-8 is about diversity and inclusion, just like using far/near instead of master/slave. People have different languages with different symbols and they shouldn't have to rename their folders to comply with the English alphabet.

     

    Last edit: Someone 2021-07-02
  • Ludovic LANGE

    Ludovic LANGE - 2021-07-30

    Hello,
    Just expressing my support on this MR.
    Also wanted to share with @shashurup and others a small fix that is needed for me:

    --- imap_utf7.old.c 2021-07-30 02:21:54.519482286 +0200
    +++ imap_utf7.c 2021-07-30 02:21:41.406350376 +0200
    @@ -222,6 +222,7 @@
         } else {
           if (inp[0] == '&' && inp[1] != '-') {
             decoding = 1;
    +        fifo.bits = 0;
           } else {
             push_char(&outp, inp[0]);
             if (inp[0] == '&' && inp[1] == '-')
    

    without this fix I have a decoding error, you can check it with this small program:

    #include "imap_utf7.h"
    #include <stdio.h>
    #include <stdlib.h>
    
    int main() {
      char *arg = "T&AOk-l&AOk-";
      char *encoded_arg = 0;
    
      encoded_arg = imap_utf7_decode(arg);
    
      printf("Before:\t%s\n", arg);
      printf("After:\t%s\n", encoded_arg);
    
      free(encoded_arg);
    }
    

    Unpatched, the output is:

    Before: T&AOk-l&AOk-
    After:  Tél:
    

    Patched, the output is:

    Before: T&AOk-l&AOk-
    After:  Télé
    
     
    • Georgy Kibardin

      Georgy Kibardin - 2021-08-07

      Hi Ludovic!

      Thank you for the fix!
      Merged.

       
  • Grigory Kirillov

    Hello, I'm here expressing my support on merging this too. My email provider also uses UTF-8 encoding for names of mail boxes and the problem is that I can't rename them. I really like how fast and lightweight isync is, there is only one missing piece for me (not only for me I bet) - this feature. Please add this, it fixes my names too :)

    Thank you for your work on isync!

     
  • Oswald Buddenhagen

    i've merged a significantly modified version of this as 52c063fd45.

     
  • Oswald Buddenhagen

    • Status: open --> merged
     

Log in to post a comment.