Foxpro‎ > ‎

Cantonese Input

Here are the download links to my Cantonese Input Method compiled with Visual Foxpro 6 and 9 respectively. The topmost one is the most recent version. All of them contain canton.dbf the database.

 Visual Foxpro 9 Setup
  Visual Foxpro 6 Setup

chang_canton-20160323.exe
chang_canton-20160110a.exe
chang_canton-20160110.exe
chang_canton-20150909.exe
chang_canton-20150327.exe
chang_canton-20150326.exe


chang_canton-20140829.exe
chang_canton-20140410.exe
chang_canton-20130301.exe
chang_canton-20130202.exe
chang_canton-20130201.exe
chang_canton-20130124.exe


SourceForge link: http://sourceforge.net/projects/changscantoneseinput/

My Cantonese Input program was intially written in Visual Foxpro 6 (with SP5) for Windows. The program is using Big5 character encoding, NOT Unicode, because Visual Foxpro had never supported Unicode. You will need to set Windows' system locale to Big5 first to run the program.

There are workarounds, but I haven't gotten time to research on them. The best one is VFP dotNet Extender, but it required Visual Foxpro 9. dotNet Extender was supposed to allow you to use dotNet Unicode UI classes in VFP forms. Another method is to switch everything to Micro$oft Access or Visual C#, which would require my aging brain to learn new programming languages.... :)

Micro$oft ActiveX Control Pad (for use of FM20.DLL):
http://download.microsoft.com/download/activexcontrolpad/install/4.0.0.950/win98mexp/en-us/setuppad.exe

Update 16 Oct 2014:

Found a way to make VFP 6 to pass UTF-8 characters properly to MS Form 2.0 ActiveX controls. The trick uses the Unicode clipboard of Windows.

First, the UTF-8 column in canton.dbf were encoded using Base64 algorihtm. To push UTF-8 to an MS Forms 2.0 textbox, the decoded Base64 value (now a UTF-8 character) were FILETOSTR() to a text file temp.txt, CLIP was called to copy the content of temp.txt to clipboard, after calling CHCP 65001 to switch the codepage to UTF-8. With the UTF-8 character in clipboard, textbox.paste() was called.

The above  method involves shelling to Command Prompt to execute those commands as a batch file. To speed things up, a Visual C++ or C# DLL could be developed to do the exact same things.

VFP 6 doesn't support SYS(3101, 65001) and STRCONV(xxx, [6..14]) as in VFP 9. It does have SYS(3005), but executing SYS(3005,65001) doesn't actually work, though VFP 6 still reports a codepage of 65001 when calling SYS(3004).

The above method does NOT work for REPORT FORM, I believe. I couldn't find a way to use ActiveX controls in REPORT FORM. So I still cannot print Unicode characters. Some said VFP 9 could do it. Well.... later!

Update 18 Sep 2014:


Starting September 2014, I was testing Visual Foxpro 9 as a way to add UTF-8 support in the input program. This made it possible to display and copy to clipboard HKSCS-2008 characters (e.g. "埗", "邨", ...)!  You can download the source code of the progrom below and compile it yourself. To execute it, use Visual Foxpro 9's Runtime Installer: http://www.foxpert.com/runtime.htm ! I am finding a way to produce and distribute executables....

Note that Visual Foxpro 9 does NOT support UTF-16 (e.g. "𨋢"), but UTF-8!

The VFP dotNet Extender product had disappeared. So I am now using Micro$oft Forms 2.0 ActiveX controls to display UTF-8 characters. However, VFP 6 automatically convert data from Forms 2.0 controls to english character set whenever data were stored into variables, making it impossible to retrieve raw data (in the form of UTF-8 binary values) from ActiveX controls.
ċ
canton-20120314.prg.txt
(32k)
Man-wai Chang,
Apr 3, 2013, 8:34 AM
ċ
canton-20130124.prg.txt
(34k)
Man-wai Chang,
Feb 1, 2013, 9:47 AM
ċ
canton-20130201.prg.txt
(35k)
Man-wai Chang,
Feb 1, 2013, 9:47 AM
ċ
canton-20130202.prg.txt
(35k)
Man-wai Chang,
Feb 2, 2013, 3:13 AM
ċ
canton-20130301.prg.txt
(36k)
Man-wai Chang,
Mar 1, 2013, 3:08 AM
ċ
canton-20140410.prg.txt
(37k)
Man-wai Chang,
Apr 10, 2014, 8:11 AM
ċ
canton-20140829.prg.txt
(39k)
Man-wai Chang,
Aug 29, 2014, 6:13 AM
ċ
canton-20140915.PRG.txt
(53k)
Man-wai Chang,
Sep 15, 2014, 8:49 AM
ċ
canton-20140918.prg.txt
(54k)
Man-wai Chang,
Sep 18, 2014, 3:52 AM
ċ
canton-20141016.PRG.txt
(57k)
Man-wai Chang,
Oct 16, 2014, 8:00 AM
ċ
canton-20141017.PRG.txt
(63k)
Man-wai Chang,
Oct 17, 2014, 8:16 AM
ċ
canton-20141021.PRG.txt
(64k)
Man-wai Chang,
Oct 21, 2014, 7:45 AM
ċ
canton-20150326.PRG.txt
(66k)
Man-wai Chang,
Mar 26, 2015, 5:03 AM
ċ
canton-20150327.PRG.txt
(66k)
Man-wai Chang,
Mar 30, 2015, 4:45 AM
ċ
canton-20150929.prg.txt
(66k)
Man-wai Chang,
Sep 9, 2015, 4:36 AM
ċ
canton-20160323.prg.txt
(72k)
Man-wai Chang,
Mar 23, 2016, 7:44 AM
Comments