RamonUnch / GreenPad

Fork from roytam1 fork from original GreenPad
22 stars 0 forks source link

Support more codepages via ICU uconv #60

Open roytam1 opened 1 year ago

roytam1 commented 1 year ago

I wonder if we can call ICU's uconv.exe for supporting codepages that windows doesn't support, for example EBCDIC DBCS codepages.

RamonUnch commented 1 year ago

This should be possible and would be nice, I was thinking to dynamically load iconv.dll if it were present. I did not know about uconv, does it have advantages compared to iconv? is there a uconv.dll that would be easier to use than running an exe?

roytam1 commented 1 year ago

I did not know about uconv, does it have advantages compared to iconv? is there a uconv.dll that would be easier to use than running an exe?

uconv comes from IBM ICU ( https://icu.unicode.org/ ), and uconv has advantage over iconv is uconv supports EBCDIC DBCS codepages. and for using EXE instead of DLL is license issues. Running external program doesn't have any license problem. But if you use DLL style then you have to face license issue. libiconv is GNU GPL license, if you link to it by DLL functions, then your program has to be GPL as well. ( ref: https://stackoverflow.com/a/1717509 )

of course there is alternative with more free license, like bsdconv ( https://github.com/buganini/bsdconv/ ) that you can use in DLL style, but you will need to modify bsdconv to make it work in single-DLL style instead of having bunch of DLLs.

RamonUnch commented 1 year ago

GPL is quite contagious. But would this even apply if the dependency is optional and the dll is not shipped with GreenPad? There seems to be quite some debates about this so better safe than sorry.

Either way the difference between running an external optional exe and an external optional dll seems very minor. The difference to me is even more minor than between a static linking and non optional dynamic linking. which already seems to be a huge debate.

I would suspect that if the optional dll is GPL-contagious, then the optional exe is also contagious, running an external exe otherwise would be an universal trick against GPL contamination.

Either way we could make a very simple conv.dll that would have the same interface than uconv but in the public domain, and people would be able to use other dlls.

roytam1 commented 1 year ago

Either way the difference between running an external optional exe and an external optional dll seems very minor.

but it involves non-standard API for calling external DLL. Running EXE doesn't involve this.

RamonUnch commented 1 year ago

True, plus it would be even more flexible and allow for other converters in the future.

RamonUnch commented 1 year ago

I saw that you had made a build of uconv on your blog, nice build, I will experiment with that...