contacts icon indicating copy to clipboard operation
contacts copied to clipboard

Broken encoding in Thunderbird

Open dniku opened this issue 8 years ago • 3 comments

Steps to reproduce

  1. Create a contact with Cyrillic characters in it (example name: Михаил Лифшиц)
  2. Sync it to a latest Thunderbird with SoGo Connector
  3. Observe broken encoding in the interface (example result: 8E08; 8DH8F, or b'\x1c8E08; \x1b8DH8F' using Python's repr() notation)

Expected behaviour

Correct encoding

Actual behaviour

Broken encoding

Configuration

Please see https://github.com/owncloud/contacts/issues/359. The only difference is that the Contacts app version is now 1.2.0.0.

I've put together a Python function which deciphers this encoding:

data = b'\x1c8E08; \x1b8DH8F'

def decode_letter(c):
    if 16 <= c < 16 + 32:
        return chr(ord('А') + (c - 16))
    elif 48 <= c < 48 + 32:
        return chr(ord('а') + (c - 48))
    elif c == 81:
        return 'ё'


def decode(c):
    enabled_chars = ' -:().?'
    if 32 <= c <= 64 or c == 81:
        if chr(c) in enabled_chars:
            # return '(%c|%c)' % (decode_letter(c), chr(c))
            return chr(c)
        return decode_letter(c)
    elif 16 <= c < 48 + 32:
        return decode_letter(c)
    elif c == 10:
        return '\n'
    else:
        print(c)
        return '&'

print(''.join(decode(c) for c in data))

If I open up the Thunderbird interface and manually replace (by typing) the data for one contact with the correct encoding, it seems to save and work normally — just for that one contact. The others remain broken.

The web interface seems to show the contact names properly, although I've found that one of the contacts I've changed through Thunderbird now has broken encoding in the web interface too. The others I've modified with Thunderbird still seem to have correct data.

I also have one contact group which seems to be an incorrectly-encoded version of a contact group I used to have. Now some of the contacts which used to be in that group have an incorrectly-encoded version of the group name, while others remain correct. If I try to filter the contacts by that group (by clicking on the group name in the left panel in the web interface), the effect is the same as if I clicked on "All contacts".

I'm not sure if this is a problem with SoGo or ownCloud.

dniku avatar May 02 '16 11:05 dniku