Ticket #3227 (closed enhancement: fixed)

Opened 18 months ago

Last modified 12 months ago

Unicode doesn't work with emoticons

Reported by: m_gol Owned by: asterix
Priority: normal Milestone: 0.11.4
Component: chat Version: 0.11.2
Severity: normal Keywords:
Cc: OS: All

Description

When I try to make my own set of emoticons, I cannot put tekst written in Unicode (with ą, ę, ł etc.) in emoticons.py. I moved to Jabber from Polish IM named Gadu-Gadu and I think many people doing the same would like to have their old, GG-style emoticons in Gajim; but they can't do this, because some emots used in GG uses Unicode characters (for example, <głaszcze> should return one of emoticons).

Attachments

utf_8_emots.patch (0.8 kB) - added by asterix 14 months ago.
handle utf-8 emoticons

Change History

Changed 16 months ago by asterix

  • milestone set to 0.12

see also #3327

Changed 16 months ago by asterix

adding

# coding=utf-8

at the begining of the file fixes the problem (see http://www.python.org/dev/peps/pep-0263/)

I add that line to existing pack in our sources

Changed 16 months ago by asterix

  • status changed from new to closed
  • resolution set to fixed

(In [8554]) add encoding to emoticons files. fixes #3227

Changed 15 months ago by roidelapluie

(In [8606]) Add encoding to emoticons files. Fix #3227.

Changed 15 months ago by roidelapluie

  • milestone changed from 0.12 to 0.11.2

Changed 14 months ago by m_gol

  • status changed from closed to reopened
  • version changed from 0.11.1 to 0.11.2
  • resolution fixed deleted

I don't know how to do it - I added a following line:

'<głaszcze>': 'coolglasses.png',

to my emoticons.py and it didn't work; when I wrote <glaszcze> instead of <głaszcze>, it worked. I tried to add the information about UTF-8 coding at the beginning of the emoticons.py file and it didn't change anything, again.

I have "static" emoticon set enabled.

Changed 14 months ago by asterix

handle utf-8 emoticons

Changed 14 months ago by asterix

  • milestone changed from 0.11.2 to 0.11.3

could you test the attached patch ?

Changed 14 months ago by m_gol

How can I apply it? I can see a gajim.py file neither in my src Gajim directory nor anywhere else inside the Gajim folder.

Changed 14 months ago by asterix

it is in src folder. But maybe you're under winows ?

Changed 14 months ago by m_gol

Yes, I'm under Windows, temporarily.

Changed 14 months ago by asterix

ok so forget it. There are many things to install to use vn version under windows. I tested under lin and tried with chars like é and that works. So I'll commit it.

Changed 14 months ago by asterix

hmm there is a problem with the IGNORECASE of re module:

re.search('é', 'qwért', re.IGNORECASE)

that works

now if I do the same with 'qwÉrt' instead of 'qwért', that doesn't work.

so if you write ":é" as an emoticone in emoticons.py, only :É will work.

Changed 13 months ago by asterix

  • milestone changed from 0.11.3 to 0.12

Changed 12 months ago by m_gol

"so if you write ":é" as an emoticone in emoticons.py, only :É will work." So couldn't You just put the to-be-emoticon text through some procedure, to translate it from ":é" to ":É"? Then emots would fit chosen pattern (after some changes), wouldn't they?

Changed 12 months ago by asterix

it's what we do, when we load emoticons, we upper() them. and when we compare, we use the re.IGNORECASE argument, so it should match, but it doesn't.

I just posted to comp.lang.python ... I'll see

Changed 12 months ago by asterix

  • status changed from reopened to closed
  • resolution set to fixed

(In [9053]) handle unicode chars in emoticons. fixes #3227

Changed 12 months ago by asterix

(In [9054]) handle unicode chars in emoticons. fixes #3227

Changed 12 months ago by asterix

  • milestone changed from 0.12 to 0.11.4

Add/Change #3227 (Unicode doesn't work with emoticons)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.