1. Unicode Euphoria?
- Posted by Aku <akusaya at gmx.net> Apr 23, 2007
- 489 views
Since now Euphoria is already open source, is there any plan to make Eu 100% unicode compatible? In my mind, looks like we can make Eu unicode enabled by doing the following: 1. replace built-in functions open(), dir(), puts() and so on with the unicode equivalent e.g. override open() with own function such as calling the win32 API (forget dos and linux, no real unicode support) 2. unfortunately we can't override built-in library functions (like get.e) as easy as built-in functions, so the std lib files need to be modified (e.g. get_bytes) 3. edit optional libraries like win32lib to use the unicode version of the win32 API which means we do not need to edit Eu interpreter/compiler source code at all. Is that correct? Anyone interested in having Eu support unicode?
2. Re: Unicode Euphoria?
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Apr 23, 2007
- 492 views
Aku wrote: > > Since now Euphoria is already open source, is there any plan to make > Eu 100% unicode compatible? > > In my mind, looks like we can make Eu unicode enabled by doing > the following: > > 1. replace built-in functions open(), dir(), puts() and so on > with the unicode equivalent e.g. override open() with own function > such as calling the win32 API (forget dos and linux, no real > unicode support) > > 2. unfortunately we can't override built-in library functions (like get.e) > as easy as built-in functions, so the std lib files need to be modified > (e.g. get_bytes) > > 3. edit optional libraries like win32lib to use the unicode version > of the win32 API > > which means we do not need to edit Eu interpreter/compiler source > code at all. > > Is that correct? > > Anyone interested in having Eu support unicode? This would be a desirable step forward. However, it may not be as easy technically. For instance, open() directly calls C code in the standard library, so you'd need to build a separate Eu version, I think. I didn't investigate further - see the thread on accented characters in directories under Windows. The relevant function in be_runtime.c is EOpen(). I guess puts() and friends are coded the same. Additionally, the way Windows supports Unicode is different on 9/Me and NT based systems. I don't know if this is an issue, but remember there are still quite a few people using 98. Again, I'm just saying hat it is a tad more involved technically than it would look at first glance. But it would be a desirable improvement. CChris
3. Re: Unicode Euphoria?
- Posted by Bernie Ryan <xotron at bluefrog.com> Apr 23, 2007
- 493 views
Aku wrote: > > Since now Euphoria is already open source, is there any plan to make > Eu 100% unicode compatible? > > In my mind, looks like we can make Eu unicode enabled by doing > the following: > > 1. replace built-in functions open(), dir(), puts() and so on > with the unicode equivalent e.g. override open() with own function > such as calling the win32 API (forget dos and linux, no real > unicode support) > > 2. unfortunately we can't override built-in library functions (like get.e) > as easy as built-in functions, so the std lib files need to be modified > (e.g. get_bytes) > > 3. edit optional libraries like win32lib to use the unicode version > of the win32 API > > which means we do not need to edit Eu interpreter/compiler source > code at all. > > Is that correct? > > Anyone interested in having Eu support unicode? Hi Aku UNICODE procedures/functions are a part of windows already. All you need to due is wrap the procedures/functions that you want to use. All unicode procedures/functions names end with a "W". Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
4. Re: Unicode Euphoria?
- Posted by Aku <akusaya at gmx.net> Apr 23, 2007
- 486 views
CChris wrote: > This would be a desirable step forward. However, it may not be as easy > technically. > > For instance, open() directly calls C code in the standard library, so you'd > > need to build a separate Eu version, I think. I didn't investigate further - > > see the thread on accented characters in directories under Windows. The > relevant function in be_runtime.c is EOpen(). I guess puts() and > friends are coded the same. > > Additionally, the way Windows supports Unicode is different on 9/Me and NT > based > systems. I don't know if this is an issue, but remember there are still > quite a few people using 98. > > Again, I'm just saying hat it is a tad more involved technically than it > would look at first glance. But it would be a desirable improvement. > That's why I said to override the built-in function. AFAIK, eu built in functions can be overridden by just declaring a function with the same name. For example
function open(sequence nf, sequence mode) return CreateFileW(nf, ...) end function
About windows support, Windows XP is released in 2001, 6 years has passed, I don't think we should keep being stalled because of that, yes? Because if it is possible without too much work, maybe we can develop a "unicode compability layer" for euphoria which contains: - replacement files for get.e, file.e, machine.e etc to support unicode. - a new library file (e.g. eunicode.e) to override built-in functions. Then as much as possible old programs will run unchanged (except addition of eunicode.e).
5. Re: Unicode Euphoria?
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Apr 23, 2007
- 515 views
Aku wrote: > 1. replace built-in functions open(), dir(), puts() and so on > with the unicode equivalent e.g. override open() with own function > such as calling the win32 API (forget dos and linux, no real > unicode support) Eh. I've got a unicode locale selected here. I can edit files containing utf8 characters and save and open files with filenames containing utf8 characters. And yes, the characters do display correctly, whether they are swedish, japanese, russian, greek etc. I 'm not sure, but I do think linux has unicode support ;) Regards, Alexander Toresson