tweezy23 / anyedittools

Automatically exported from code.google.com/p/anyedittools
2 stars 0 forks source link

Add "ISO-8859-1" encode/decode actions for special characters (like à) #76

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First of all, congratulations for this Amazing tool! My suggestion is to 
support ISO-8859-1 as this is the format accepted when using JSF. AnyEdit will 
get pretty famous between developers with this support.

Best regards!

Original issue reported on code.google.com by mchamati on 6 Nov 2012 at 3:21

GoogleCodeExporter commented 9 years ago
Is is not a Defect, but I could not change it.

Original comment by mchamati on 6 Nov 2012 at 3:22

GoogleCodeExporter commented 9 years ago
Sorry, I can't get your point. File encoding in JSF editor is nothing AnyEdit 
changes or does not support - it is just outside of the scope of the AnyEdit 
functionality. Might be a small example could help me to understand what 
actually your problem is and how AnyEdit is supposed to fix it?
CU
Andrey

Original comment by iloveeclipse on 6 Nov 2012 at 9:21

GoogleCodeExporter commented 9 years ago
Of course, maybe I was not clear enough. When using Eclipse to edit files for 
JSF framework, we have tags like this:

     <p:menuitem value="a" url="/pages/a.jsf" />

However, if I would like to use into value attribute any character with 
accentuation as below the application will break:

     <p:menuitem value="á" url="/pages/a.jsf" />

There are two solutions that work. The first one is to put the value refering 
to a bundle file (i18n). Another solution that works is to encode the character 
'á' using ISO-8859-1, having then the result below:

     <p:menuitem value="á" url="/pages/a.jsf" />

For this reason, I emphatisis that would be perfect if AnyEdit could support 
this enconding. Maybe activating enconding in Eclipse meu "Windows > 
Preferences..."

Here we have examples about many mapping to ISO-8859-1 encoding: 
http://www.ic.unicamp.br/~stolfi/EXPORT/www/ISO-8859-1-Encoding.html

Anyway, only a suggestion!

Best regards!

Original comment by mchamati on 6 Nov 2012 at 9:41

GoogleCodeExporter commented 9 years ago
Ok, thanks, I've got it.
Sounds easy to implement, valuable, but I have no plans to implement it by 
myself (no time at all).
Feel free to provide a patch, I offer review and integration.
CU
Andrey

Original comment by iloveeclipse on 6 Nov 2012 at 10:37

GoogleCodeExporter commented 9 years ago
OK, could you give me some guidance about the files and its structure?

Original comment by mchamati on 7 Nov 2012 at 12:23

GoogleCodeExporter commented 9 years ago
Please check how the code below works for HTML entities conversion (both 
escape/unescape).
Entry point is in plugin.xml, see "AnyEdit.escape.command" matches.
Than check the handler code in de.loskutov.anyedit.actions.UnEscape
and the "utility" functions in TextUtil.escapeText() / TextUtil.unEscapeText().

The code is really straightforward and self explaining. 

So if you would create "AnyEdit.escapeISO.command" and 
de.loskutov.anyedit.actions.UnEscapeISO handler and TextUtil.escapeTextISO() / 
TextUtil.unEscapeTextISO() you were almost done.

You can clone the repository and after you are done, send me either link to the 
changeset or the diff, whatever you prefer.

Regards,
Andrey

Original comment by iloveeclipse on 7 Nov 2012 at 6:24

GoogleCodeExporter commented 9 years ago
Thanks a lot! I will work on it. Not right now, as I am pretty busy too, but I 
will do it soon.

Best regards,

Mauricio

Original comment by mchamati on 7 Nov 2012 at 6:41

GoogleCodeExporter commented 9 years ago
Andrey, I know has been a long time since we talked, but I have been busy since 
then. However, I do implemented the features I mention before, I just had a 
hard time using Mercurial, which I am not used to, but now it is fine. So, two 
questions then:
1) I am wondering how to test it as an Eclipse plugin before send you the 
changeset or diff, could you give me a guidance?
2) Also, is it ok to use third party lib like Apache?

Tks, Mauricio

Original comment by mchamati on 28 Nov 2013 at 3:36

GoogleCodeExporter commented 9 years ago
Mot a problem, I'm busy too :-)
In the meanwhile I've moved from Mercurial to Git :-)

To reply on your questions:
1) Manual testing is must. Automated tests are bonus. You have to put tests in 
a separated plugin, next to Anyedit directory.
2) I would prefer not to depend on 3rd party code, if possible, except the 
library is provided by the standard Eclipse.org package since (and including) 
3.7. Anyedit was / is small and simple and I would like to keep it as such.

Regards,
Andrey

Original comment by iloveeclipse on 28 Nov 2013 at 6:57