How to compile Jcode.pm on Windows 2000


© 2000.8.2, 2005.1.22 TAKAHASHI Makoto

Jcode.pm - a successor to jcode.pl is provided to support Japanese character. To improve performance, XS module was supported, but load module for Windows are not provided. Only source is provided. This is report of compilation by VC++ 6.0 and load module is also available here.

Table of contents

About conversion table

Conversion table of Jcode.pm is almost same as JIS X 0208 (1990) to Unicode of Unicode Consortium (updated 1994). This table, as Unicode Consortium itself agree, is different from current industry practice. In Unicode 5.0, U+301C is said,

This character was encoded to match JIS C 6226-1978 1-33 “wave dash”. The JIS standards and some industry practice disagree in mapping.

If so, conversion table should be chaged. But there must be some reason which could not be explained no to do so. Table below shows every program which is updating are not using table of 1994.

Difference of JIS code and Unicode correspondence
kuten code FrontPage Express/
xyzzy/
Aprotool TM Editor/
JVim/
EmEditor/
Netscape Composer 4.72/
Mozilla/
Hidemaru Editor
“JIS X 0201 (1976) to Unicode 1.1 Table” of Unicode Consotium (1994)
“JIS X 0208 (1990) to Unicode” of Unicode Consotium (1994)
Netscape Composer 4.7/
Meadow
Uniedit
05/12 U+005C U+00A5 U+005C
07/14 U+007E U+203E U+007E
01-32U+FF3CU+005CU+005C
01-33U+FF5EU+301CU+301C
01-34U+2225U+2016U+2016
01-61U+FF0DU+2212U+2212
01-81U+FFE0U+00A2U+00A2
01-82U+FFE1U+00A3U+00A3
02-44U+FFE2U+00ACU+00AC

To justify conversion table of Jcode.pm to “industry practice” c:\Jcode\unicode\euc2uni.h c:\Jcode\unicode\uni2euc.h were changed as tables below. These tables are obtained from Jcode-0.88.zip.

Modification of conversion table from euc to unicode (euc2uni.h)
kuten codeeucbeforeafter
characternameunicodecharacternameunicode
JIS X 0201
05/120x5c\Yen SignU+00A5¥Reverse SolidusU+005C
07/140x7eOverlineU+203E~TildeU+007E
JIS X 0208
01-330xa1c1Wave DashU+301CFullwidth TildeU+FF5E
01-340xa1c2Double Vertical LineU+2016Parallel ToU+2225
01-610xa1ddMinus SignU+2212Fullwidth Hyphen-MinusU+FF0D
01-810xa1f1¢ Cent SignU+00A2Fullwidth Cent SignU+FFE0
01-820xa1f2£ Pound SignU+00A3Fullwidth Pound SignU+FFE1
02-440xa2cc¬Fullwidth Not SignU+00ACNot SignU+FFE2
JIS X 0212
02-230x8fa2b7~ TildeU+007E˜ Small Tilde(*1)U+02DC
02-350x8fa2c3¦ Broken BarU+00A6Fullwidth Broken BarU+FFE4
Modification of conversion table from unicode to euc (uni2euc.h)
unicodecharacternamebeforeafter
euckuten codeeuckuten code
U+005C\Reverse Solidus0x5c05/120x5c05/12
U+007E~Tilde0x7e07/140x7e07/14
U+00A2¢Cent Sign0xa1f101-810xa1f101-81
U+00A3£Pound Sign0xa1f201-820xa1f201-82
U+00A5¥Yen Sign0x5c05/120x5c05/12
U+00A6¦Broken Bar0x8fa2c302-350x8fa2c302-35
U+00AC¬Not Sign0xa2cc02-440xa2cc02-44
U+02DC˜Small Tilde(*1)0x8fa2b702-23
U+2016Double Vertical Line0xa1c201-340xa1c201-34
U+203EOverline0x7e07/140x7e07/14
U+2212Minus Sign0xa1dd01-610xa1dd01-61
U+2225Parallel To0xa1c201-34
U+301CWave Dash0xa1c101-330xa1c101-33
U+FF0DFullwidth Hyphen-Minus0xa1dd01-61
U+FF3CFullwidth Reverse Solidus0xa1c001-320xa1c001-32
U+FF5EFullwidth Tilde0xa1c101-33
U+FFE0Fullwidth Cent Sign0xa1f101-81
U+FFE1Fullwidth Pound Sign0xa1f201-82
U+FFE2Fullwidth Not Sign0xa2cc02-44
U+FFE4Fullwidth Broken Bar0x8fa2c302-35
*1 In CP932 02-23 is mapped to U+FF5E. But U+FF5E is mapped to 01-33 also. So 02-23 is changed to map to Small Tilde of Spacing Modifier Letters:U+02DC.

Compilation

After installing Visual C++ 6.0, you will need to run the VCVARS32.BAT file usually found somewhere like C:\Program Files\Microsoft Visual Studio\VC98\bin. This will set your build environment.

C:>cd \Program Files\Microsoft Visual Studio\VC98\bin
C:\Program Files\Microsoft Visual Studio\VC98\bin>vcvars32.bat
Setting environment for using Microsoft Visual C++ tools.

Then move to folder where jcode.pm was expanded, and execute perl makefile.pl.
C:\Program Files\Microsoft Visual Studio\VC98\bin>cd \
C:\>cd jcode-0.88 C:\jcode-0.88>perl makefile.pl Checking if your kit is complete... Looks good Writing Makefile for Jcode::Unicode Writing Makefile for Jcode
This message says that you are ready to compile. It is said that nmake will create objects,
Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

cl -c  -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"0.59\"  -DXS_VERSION=\"0.59\"  -IC:\perl\lib\CORE  Unicode.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Unicode.c
"Running Mkbootstrap for Jcode::Unicode ()"
C:\perl\bin\Perl.exe -IC:\perl\lib -IC:\perl\lib -MExtUtils::Command -e chmod 644 Unicode.bs
link -out:..\blib\arch\auto\Jcode\Unicode\Unicode.dll -dll -nologo -node faultlib -release  -libpath:"C:\perl\lib\CORE"  -machine:x86 Unicode.obj   C:\perl\lib\CORE\perl56.lib oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib -def:Unicode.def
libraly ..\blib\arch\auto\Jcode\Unicode\Unicode.lib and object ..\blib\arch\auto\Jcode\Unicode\Unicode.exp are made
C:\perl\bin\Perl.exe -IC:\perl\lib -IC:\perl\lib -MExtUtils::Command -e chmod 755 ..\blib\arch\auto\Jcode\Unicode\Unicode.dll
C:\perl\bin\Perl.exe -IC:\perl\lib -IC:\perl\lib -MExtUtils::Command -e cp Unicode.bs ..\blib\arch\auto\Jcode\Unicode\Unicode.bs
C:\perl\bin\Perl.exe -IC:\perl\lib -IC:\perl\lib -MExtUtils::Command -e chmod 644 ..\blib\arch\auto\Jcode\Unicode\Unicode.bs
C:\jcode-0.88>
Then you have object files.

Test

Type nmake test to verify load modules.
C:\jcode-0.88>nmake test
t\convert...........ok
t\getcode...........ok
t\h2z...............ok
t\new...............ok
t\tr................ok
All tests successful.
Files=5, Tests=95,  9 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
'No tests defined for Jcode::Unicode extension.'
C:\jcode-0.88>
These message shows Jcode.pm functions good.

Install

nmake install command include modules into perl and ready to use.
C:\jcode-0.88>nmake install

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

Installing C:\perl\site\lib\auto\Jcode\Unicode\Unicode.dll
Installing C:\perl\site\lib\auto\Jcode\Unicode\Unicode.lib
Installing C:\perl\site\lib\auto\Jcode\Unicode\Unicode.exp
Installing C:\perl\site\lib\auto\Jcode\Unicode\Unicode.bs
Installing C:\perl\site\lib\mac_install.pl
Installing C:\perl\site\lib\win_install.pl
Installing C:\perl\site\lib\Jcode.pm
Installing C:\perl\site\lib\Jcode\Tr.pm
Installing C:\perl\site\lib\Jcode\H2Z.pm
Installing C:\perl\site\lib\Jcode\Constants.pm
Installing C:\perl\site\lib\Jcode\_test.pl
Installing C:\perl\site\lib\Jcode\Unicode.pm
Installing C:\perl\site\lib\Jcode\Unicode\Constants.pm
Installing C:\perl\site\lib\Jcode\Unicode\NoXS.pm
Writing C:\perl\site\lib\auto\Jcode\.packlist
Appending installation info to C:\perl\lib/perllocal.pod

C:\jcode-0.88>
No XS modules that are in Unicode folder under C:\perl\site\lib\jcode were deleted and functions were tested.

Download

Compiled modules and necessary modules are in one compressed file. Download jcwin-0.88.zip.
  In Perl 5.8 Jcode.pm was included as encode. But jcwin8-0.88.zip is also available.

Expand it with directory and specify volume where perl was installed.

Diff file in jcodediff.zip is also available.

home (x)