Cyrsite
Description
Cyrsite package may be useful for people who maintain WWW
pages in Russian and who want to provide their pages in multiple encodings.
The following encodings are currently supported
koi8(koi-8r), iso5(iso-8859-5), win(CP1251), alt (CP866), mac, and
transliteration other encodings (not necessarily cyrillic) may be easily added
Current version: 1.12
Copyright Note
Copyright Ilya Sandler 1995,97
The cyrsite package is distributed under the terms of
the GNU general public license, which in particular means
- 1) there is no warranty of any kind;
- 2) you are free to use/modify this software,
- 3) this software (as well as any derived software)
may be redistributed only under the terms of GNU public license..
See
full text of the GNU public license for details
Package contents
- cyrsite.pl - CGI interface
- siteutils.pl - general utilities library
- siteparse.pl - HTML parsing library
- cyrcode.pl - external decoder
- cyrtab - encoding table
- sample.conf - sample configuration file
- README - plain text version of this file
Installation and use
Important: To use this software you need to be able to run CGI programs
on your site -- contact your webmaster about how to do this.
The installation has been simplified enormously since the 1.03 version
- create a directory named "cyrsite" somewhere:
mkdir cyrsite
I recommend to create it in your cgi-bin directory (i.e. in the directory
where your CGI programs are located)
- download cyrsite.zip into this directory
- unzip it:
unzip cyrsite.zip
- create a working configuration file:
cp sample.conf cyrsite.conf
(note, the configuration file should stay in cyrsite directory)
- change the first lines of cyrsite.pl and cyrcode.pl to point
them to location of perl compiler on your system
- if cyrsite directory is not a subdirectory of your /cgi-bin,
then change the line
$utilDir="./cyrsite"; in cyrsite.pl
so that it points to cyrsite directory
- install the file cyrsite.pl as a CGI program on your system
(ask your Webmaster about how to do it), usually you will need
to copy cyrsite.pl into your cgi-bin dir and set the appropriate
permissions (e.g
chmod 755 cyrsite.pl), note
everything in cyrsite directory should be readable by cyrsite.pl
and cyrcode.pl must be executable by cyrsite.pl
when cyrsite.pl is run as a CGI program, which means, that
you may need to set appropriate permissions for both cyrsite
directory and all the files in it (e.g.
chmod 755 cyrsite; chmod 644 *;
chmod 755 cyrcode.pl ) again, ask your Webmaster
about all the details
- edit the config file cyrsite.conf,
the default config file has a lot of comments in it, so you
shouldn't have any problem with configuring cyrsite
example of use:
(assuming that you successfully installed the package in
your server's CGI /cgi-bin/ directory).
If you have a page in KOI8 at http://yourhost/path/home.html
and you want to provide it in different encodings, you need
to put the following link onto your page
<a href="/cgi-bin/cyrsite.pl?cyrtable=win&cyrfile=/path/home.html">
switch to win encoding</a>
if a user follows this link, he/she will get your page in
windows encoding, if he follows any (local) link on this converted
page, the new page will be also in windows encoding
change "win" to "koi8", "alt","mac","iso5" or "trans"
and you will get your page in the appropriate encoding.
See also a sample page
Problems
There are a couple of problems with cyrsite which I'm aware of
- cyrsite is written in Perl, which is an interpreted language.
However both the code itself and the compiler are pretty fast, so
the end user most likely won't notice any slowdown, but if your
server is very heavily loaded, the penalty of recompiling the code
may add unacceptable extra load
to your server. It's up to you to decide if the performance of
code/compiler is acceptable for your server...
- cyrsite doesn't convert input/output for your own CGI programs..
(e.g. if you want your CGI programs to work with multiple encodings
cyrsite won't help you). While this conversion
probably can be done, I don't have enough time to work on this feature
and haven't seen any requests for it....
- There also seems to be an interference between cyrsite,
and SSI (Server Side Includes), if you do use SSI, make sure, that
SSIs are not disrupted by cyrsite....(Note, this is not a bug in
cyrsite, but rather an unfortunate feature of some (all?) SSI
implementations)..Similarly, cyrsite may interfere
with any other "on-fly" document generation system...
if you successfully install and use this package on your
site, drop me E-mail, OK?
Other comments and bug reports are welcome.
If you need to install/customize this package for your particular
system, feel free to contact me with job offers......
Ilya Sandler |
isandler@www.friends-partners.org
Last modified: Fri Jul 25 10:24:54 1997