How to really use the Multi-language capability in T24

1,046 views
Skip to first unread message

Hamza BENALI

unread,
Nov 3, 2009, 2:19:39 AM11/3/09
to jBASE
Hi to all,

Am currently working on a T24 (R09 release) development project, and
am facing the following problem :
People here are expecting printing reports in Right to Left language
(ex : Arabic).

I tried to modify the LANGUAGE App. But nothing getting fixed. Also
when i write something in Arabic in a multi-language Field,then I try
to get back to the record,I found all the arabic chars got repleaced
by '?' character. I guess its a UTF wrong coding but as T24 generate
dynamically the web pages, then I have to find a configuration way to
fix the problem for all the applications.

Regards.

Jim Idle

unread,
Nov 3, 2009, 10:37:29 AM11/3/09
to jb...@googlegroups.com
Hmm - it seems that perhaps there is a lack of documentation on how to do this for T24? ;-)

Whatever program is taking the input fields and filing them needs to know what encoding you're typing in with and the internationalization stuff for jBASE needs turning on. First, you need to understand what is going on at the jBASE level and probably write a small standalone jBC program that accepts a few fields and stores them in a file. Once you can type in the encoding that you are using and store to the database in UTF-8, then you will at least know how to configure the environment. I am afraid I cannot help much with T24 web pages but perhaps others can?

First, the i18n stuff is documented pretty well in the PDF you can download here:

http://www.jbase.com/new/support/documentation.html

Look at the Internationalization document. It isn't bad, despite being only available in PDF and this document being for 4.1 I think. At the shell you will want something like this:

bash $ export JBASE_I18N=1
bash $ export JBASE_CODEPAGE=iso-8859-6 # This is usual for Arabic but use jcodepages command
bash $ export JBASE_LOCALE=<something from the jlocales command>
bash $ export JBASE_TIMEZONE=<something from the jtimezones command>
bash $ jsh # Or your program etc

Now when jSHELL or your program starts, the jBASE runtime will pick up these variables and will expect the INPUT to be in 8859-6 code page and will convert it to UTF-8 on the fly. It will also convert PRINT output from UTF-8 into 8859-6 encoding on the fly. So any strings in your programs should be in UTF-8, they should expect data on file to be UTF-8 and let jBASE convert the output and input to whatever your output device wants. There are also conversions to convert from one codepage to another.

Similarly if data is to be converted for stoaring in UTF-8, then use the jutf8 command with the -c option:

jutf8 -c iso-8859-6 # ... etc

Now, for a web page, it is generally best that the web page is specified to be in UTF-8 and that the input given to the web page is also UTF-8. Then you need to tell the web page about right-to-left for Arabic of course. Here is the w3 tutorial on doing this:

http://www.w3.org/International/tutorials/bidi-xhtml/

I presume that there is some way to tell T24 to add such stuff into the output pages. If your users are trying to type in to the page with 8859-6 and the web page thinks it is UTF-8 then all hell will break loose ;-). So, you need to get all that bit right. If the input from the web page is UTF-8 (it should be really) then so long as everything else is configured correctly, it should all work without conversion.

Perhaps in your case, the way you are looking at the data afterwards is what makes you think it is incorrect? If you look at it in a terminal emulator that is expecting 8859-6 and you send it UTF-8 (which you will without any of the environment variables above being set, then it will look totally incorrect.

I strongly recommend using a terminal emulator that can work directly with Unicode. SecureCRT by Vandyke is the only really good terminal emulator that I know of, and I have not needed to use any other.

Now, there is more to this i18n l10n stuff than meets the eye of course because some languages need two character positions to display some characters (Kanji for instance) and the T24 programs themselves may not be ready for that. We did tons of work at jBASE 4.1 to allow programs to deal with all this though, so jBASE itself can do it. Your own programs will need to deal with such things of course. I strongly suspect that jBASE ships with an old version of the ICU libraries and is severely in need of an update - but maybe this has been accomplished with jBASE 5?

Anyway, that's how you get jBASE to deal with the general stuff, for specific T24 information, you will need help from elsewhere.

Cheers,

Jim
Reply all
Reply to author
Forward
0 new messages