Hi,
some time ago I modified the GG protocol plugin to support UTF-8 extensions added by new protocol version and fixed the plugin to work correctly with Unicode enabled.
I've been using the modified version since that time without any major problems, so I decided that it's the right time to share my code. The patch is pretty big and some changes might be rather dirty, but as I said, it is confirmed by several people that it works without any major problems.
Anyway, I'm pretty busy with other things and I'm not going to maintain/update this patch, so the best solution would be to someone adopt it or even include into the main source tree.
I'm attaching a patch based on SVN revision 13151.
Best regards Tomasz Figa
- gg_unicode_20101207_rev13151.patch 115.91KB
Comment #1
Posted on Dec 7, 2010 by Happy Bear(No comment was entered for this change.)
Comment #2
Posted on Dec 7, 2010 by Quick BearWell, your patch is incorrect. GG plugin uses 2-in-1 method, i.e. the same exact dll used for ANSI and Unicode miranda, this what gg_a2t and similar functions do, and you removed them... If you want your patch to be considered, please revise the patch, remove all mir_a2t (as this willl never workk right in gg) and put gg_a2t back.
I am closing this until revised correct patch provided.
Comment #3
Posted on Dec 7, 2010 by Happy BearExcuse me, but this work perfectly fine for me and at least 3 other people and there is no reason it shouldn't work.
There is no way you can provide a single DLL for both Miranda version without completely removing Unicode support (or replacing it with translation from Unicode to ANSI, which is just the same, because it strips any extra characters unavailable in current charset, ie. Win1250).
Also I don't see a reason why mir_a2t wouldn't work. It translates from ANSI to Unicode when Unicode is enabled or just duplicates the string in the other case. This is not my business but IMHO this is not my solution which is wrong, but yours.
Comment #4
Posted on Dec 7, 2010 by Happy Hippo@borkra
You wrong, ANSI version not provide receiving and sending Unicode data. GG Protocol from GG 8 version support this and tomasz.figa patch work for me without problems. With this patch I can set Unicode status and send/receive Unicode data, without it a got scrambled text and/or missing characters when using Unicode. This should be re-opened and patch should be merged to trunk.
Comment #5
Posted on Dec 7, 2010 by Quick Bear- You obviously did not try to use your stuff with ANSI Miranda.
- mir_a2t will not work because GG compiled once without UNICODE flag for release (VC2008 VC2010 projects that nobody uses, so I do not know what they set to). So as a result mir_a2t will be always mir_a2a
(or replacing it with translation from Unicode to ANSI) And this is exactly what gg_xxx functions do, they look on Miranda version info and perform Unicode conversion if needed.
which is just the same No, it's not, because we do it other way.
- tapico, I am not talking ANSI version of Miranda which you obviously do not use. And yes ANSI version of Miranda should support Unicode, because current locale different for different people. And version of GG protocol is irrelevant. I am talking here about Miranda version.
Comment #6
Posted on Dec 7, 2010 by Happy Bear- I think that I also tested my changes with ANSI version of Miranda, but this was pretty long time ago. So I may recheck that. Anyway, I see no reason why it wouldn't work.
- Is there anything wrong with mir_a2a (=== mir_strdup)? It just doesn't perform any conversion.
- Even forgetting that this is less effective (checking a condition every gg_x2y), it is wrong because there are many Miranda APIs taking xxx_TCHAR (resolving to 0 on !UNICODE and xxx_WCHAR on UNICODE, since xxx_WCHAR variant is unsupported when UNICODE is disabled) flags and changing the behavior of passed parameters interpretation, without which you couldn't pass an UTF-8 encoded message without any loss caused by charset conversion.
- With Unicode version of Miranda and its plugins, you could forget about any locale differences.
Comment #7
Posted on Dec 7, 2010 by Grumpy BearHi guys,
I had already started working on GG transition to Unicode some time ago. The work is almost finished now, I just postponed the patch because I want to fix file transfers first (which also needs to be Unicode). So don't worry, GG will be Unicode and will support UTF-8, just give me some time to fix some things.
Comment #8
Posted on Dec 7, 2010 by Happy Bear(No comment was entered for this change.)
Comment #9
Posted on Dec 7, 2010 by Quick Bear@tomasz.figa 1. The problem is not that it can not work the way you did it, but that is not the style that was chosen by GG plugin, and when you are providing the patch you need to match the style chosen.
- Yes, with Unicode you can forget about local differences, but we still provide ANSI Miranda version and there we cannot forget about it...
Comment #10
Posted on Dec 20, 2010 by Happy HippoStill providing ANSI Miranda is for me silly thing, only add developing effort and nothing else. Almost no one is using Windows 9x systems. Even Windows XP is not dominating, right now most popular is Windows 7.
Status: Started
Labels:
Type-Patch
Priority-Low
Component-Protocol-GaduGadu