GreenPad icon indicating copy to clipboard operation
GreenPad copied to clipboard

Support more codepages via ICU uconv

Open roytam1 opened this issue 2 years ago • 6 comments

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

roytam1 avatar Jan 08 '23 12:01 roytam1

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?

RamonUnch avatar Jan 08 '23 14:01 RamonUnch

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.

roytam1 avatar Jan 08 '23 15:01 roytam1

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.

RamonUnch avatar Jan 08 '23 16:01 RamonUnch

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.

roytam1 avatar Jan 08 '23 16:01 roytam1

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

RamonUnch avatar Jan 08 '23 17:01 RamonUnch

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

RamonUnch avatar Mar 01 '23 22:03 RamonUnch