#!/usr/bin/perl -w

use strict;
use CGI;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);

my @noms_champ = $cgi->param();
my $requete = $cgi->param('requete');

print $cgi->header(),
      $cgi->start_html('RESULTAT'),
#    $cgi->param('requete');
    $cgi->h3('Voici le r&eacute;sultat (utilisable dans un fichier html)&nbsp;:');

print '<pre class="verbatim">';

$_ = $requete;


s/<r/&\#8165\;/g;
#s/r9/&\#8165\;/g;
s/>r/&\#8164\;/g;
#s/r0/&\#8164\;/g;
s/<R/&\#8172\;/g;
s/>R/&\#8172\;/g;

s/>\'a\|/&\#8068\;/g;
s/\'>a\|/&\#8068\;/g;
#s/a0\/\|/&\#8068\;/g;
s/<\'a\|/&\#8069\;/g;
s/\'<a\|/&\#8069\;/g;
#s/a9\/\|/&\#8069\;/g;
s/>\`a\|/&\#8066\;/g;
s/\`>a\|/&\#8066\;/g;
#s/a0\\\|/&\#8066\;/g;
s/<\`a\|/&\#8067\;/g;
s/\`<a\|/&\#8067\;/g;
#s/a9\\\|/&\#8067\;/g;
s/>\\\~a\|/&\#8070\;/g;
s/>\~a\|/&\#8070\;/g;
s/\\~>\a\|/&\#8070\;/g;
s/\~>a\|/&\#8070\;/g;
s/<\\\~a\|/&\#8071\;/g;
s/<\~a\|/&\#8071\;/g;
s/\\~<\a\|/&\#8071\;/g;
s/\~<a\|/&\#8071\;/g;

s/\'a\|/&\#8116\;/g;
s/\`a\|/&\#8114\;/g;
s/\\\~a\|/&\#8119\;/g;
s/\~a\|/&\#8119\;/g;
s/>a\|/&\#8064\;/g;
#s/a0\|/&\#8064\;/g;
s/<a\|/&\#8065\;/g;
#s/a9\|/&\#8065\;/g;
s/a\|/&\#8115\;/g;
s/<\'a/&\#7941\;/g;
#s/a\(\//&\#7941\;/g;
#s/a9\//&\#7941\;/g;
#s/a\/\(/&\#7941\;/g;
#s/a\/9/&\#7941\;/g;
s/>\'a/&\#7940\;/g;
#s/a0\//&\#7940\;/g;
#s/a\/\)/&\#7940\;/g;
#s/a\/\0/&\#7940\;/g;
#s/a1/&\#7940\;/g;
s/>\`a/&\#7938\;/g;
#s/a0\\/&\#7938\;/g;
#s/a2/&\#7938\;/g;
#s/a\\\)/&\#7938\;/g;
#s/a\\\0/&\#7938\;/g;
s/<\a/&\#7939\;/g;
#s/a9\\/&\#7939\;/g;
#s/a4/&\#7939\;/g;
#s/a\\\(/&\#7939\;/g;
#s/a\\9/&\#7939\;/g;
s/>\~a/&\#7942\;/g;
s/>\\\~a/&\#7942\;/g;
#s/a0\=/&\#7942\;/g;
#s/a\]/&\#7942\;/g;
s/<\~a/&\#7943\;/g;
s/<\\\~a/&\#7943\;/g;
#s/a\[/&\#7943\;/g;
s/\'a/&\#8049\;/g;
s/\`a/&\#8048\;/g;
s/>a/&\#7936\;/g;
#s/a0/&\#7936\;/g;
s/<a/&\#7937\;/g;
#s/a9/&\#7937\;/g;
s/\\\~a/&\#8118\;/g;
s/\~a/&\#8118\;/g;


s/>\'A/&\#7948\;/g;
#s/A\)\&/&\#7948\;/g;
s/<\'A/&\#7949\;/g;
s/>\`A/&\#7946\;/g;
#s/A\)\\/&\#7946\;/g;
s/<\`A/&\#7947\;/g;
#s/A\(\\/&\#7947\;/g;
s/>\\\~A/&\#7950\;/g;
s/>\~A/&\#7950\;/g;
#s/A\)\=/&\#7950\;/g;
#s/A\)\~/&\#7950\;/g;
s/<\\\~A/&\#7951\;/g;
s/<\~A/&\#7951\;/g;
#s/A\(\=/&\#7951\;/g;
#s/A\(\~/&\#7951\;/g;
s/\'A/&\#8123\;/g;
s/\`A/&\#8122\;/g;
s/>A/&\#7944\;/g;
s/<A/&\#7945\;/g;

s/>\'e/&\#7956\;/g;
#s/e0\//&\#7956\;/g;
#s/e1/&\#7956\;/g;
s/<\'e/&\#7957\;/g;
#s/e9\//&\#7957\;/g;
#s/e3/&\#7957\;/g;
s/>\`e/&\#7954\;/g;
#s/e0\\/&\#7954\;/g;
#s/e2/&\#7954\;/g;
s/<\`e/&\#7955\;/g;
#s/e9\\/&\#7955\;/g;
#s/e4/&\#7955\;/g;
s/>e/&\#7952\;/g;
#s/e0/&\#7952\;/g;
s/<e/&\#7953\;/g;
#s/e9/&\#7953\;/g;
s/\'e/&\#8051\;/g;
s/\`e/&\#8050\;/g;
s/>E/&\#7960\;/g;
s/<E/&\#7961\;/g;
s/>\'E/&\#7964\;/g;
#s/E\!/&\#7964\;/g;
s/<\'E/&\#7965\;/g;
#s/E\#/&\#7965\;/g;
s/>\`E/&\#7962\;/g;
#s/E\@/&\#7962\;/g;
s/<\`E/&\#7963\;/g;
#s/E\$/&\#7963\;/g;
s/\'E/&\#8137\;/g;
s/\`E/&\#8136\;/g;

s/>\'h\|/&\#8084\;/g;
#s/h0\/\|/&\#8084\;/g;
#s/h1\|/&\#8084\;/g;
s/<\'h\|/&\#8085\;/g;
#s/h9\/\|/&\#8085\;/g;
#s/h3\|/&\#8085\;/g;
s/>\`h\|/&\#8082\;/g;
#s/h0\\\|/&\#8082\;/g;
#s/h2\|/&\#8082\;/g;
s/<\`h\|/&\#8083\;/g;
#s/h9\\\|/&\#8083\;/g;
#s/h4\|/&\#8083\;/g;
s/>\\\~h\|/&\#8086\;/g;
s/>\~h\|/&\#8086\;/g;
#s/h0\=\|/&\#8086\;/g;
#s/h\]\|/&\#8086\;/g;
s/<\\\~h\|/&\#8087\;/g;
s/<\~h\|/&\#8087\;/g;
#s/h9\=\|/&\#8087\;/g;
#s/h\[\|/&\#8087\;/g;
s/\'h\|/&\#8132\;/g;
s/\`h\|/&\#8130\;/g;
s/\\\~h\|/&\#8135\;/g;
s/\~h\|/&\#8135\;/g;
s/>h\|/&\#8080\;/g;
#s/h0\|/&\#8080\;/g;
s/<h\|/&\#8081\;/g;
#s/h9\|/&\#8081\;/g;
s/h\|/&\#8131\;/g;
s/>\'h/&\#7972\;/g;
#s/h0\//&\#7972\;/g;
#s/h1/&\#7972\;/g;
s/<\'h/&\#7973\;/g;
#s/h9\//&\#7973\;/g;
#s/h3/&\#7973\;/g;
s/>\`h/&\#7970\;/g;
#s/h0\\/&\#7970\;/g;
#s/h2/&\#7970\;/g;
s/<\`h/&\#7971\;/g;
#s/h9\\/&\#7971\;/g;
#s/h4/&\#7971\;/g;
s/>\\\~h/&\#7974\;/g;
s/>\~h/&\#7974\;/g;
#s/h0\=/&\#7974\;/g;
#s/h\]/&\#7974\;/g;
s/<\\\~h/&\#7975;/g;
s/<\~h/&\#7975;/g;
#s/h9\=/&\#7975;/g;
#s/h\[/&\#7975;/g;
s/\'h/&\#8053\;/g;
s/\`h/&\#8052\;/g;
s/\\\~h/&\#8134\;/g;
s/\~h/&\#8134\;/g;
s/>h/&\#7968\;/g;
#s/h0/&\#7968\;/g;
s/<h/&\#7969\;/g;
#s/h9/&\#7969\;/g;

s/>H\|/&\#8088\;/g;
s/<H\|/&\#8089\;/g;
s/>\'H\|/&\#8092\;/g;
#s/H\!\|/&\#8092\;/g;
s/<\'H\|/&\#8093\;/g;
#s/H\#\|/&\#8093\;/g;
s/>\`H\|/&\#8090\;/g;
#s/H\@\|/&\#8090\;/g;
s/<\`H\|/&\#8091\;/g;
#s/H\$\|/&\#8091\;/g;
s/>\\\~H\|/&\#8094\;/g;
s/>\~H\|/&\#8094\;/g;
#s/H\]\|/&\#8094\;/g;
s/<\\\~H\|/&\#8095\;/g;
s/<\~H\|/&\#8095\;/g;
#s/H\{\|/&\#8095\;/g;
s/H\|/&\#8140\;/g;
s/>\'H/&\#7980\;/g;
#s/H\!/&\#7980\;/g;
s/<\'H/&\#7981\;/g;
#s/H\#/&\#7981\;/g;
s/>\`H/&\#7978\;/g;
#s/H\@/&\#7978\;/g;
s/<\`H/&\#7979\;/g;
#s/H\$/&\#7979\;/g;
s/>\\\~H/&\#7982\;/g;
s/>\~H/&\#7982\;/g;
#s/H\]/&\#7982\;/g;
s/<\\\~H/&\#7983\;/g;
s/<\~H/&\#7983\;/g;
#s/H\{/&\#7983\;/g;
s/\'H/&\#8139\;/g;
s/\`H/&\#8138\;/g;
s/>H/&\#7976\;/g;
s/<H/&\#7977\;/g;


s/>\'i/&\#7988\;/g;
#s/i0\//&\#7988\;/g;
#s/i1/&\#7988\;/g;
s/<\'i/&\#7989\;/g;
#s/i9\//&\#7989\;/g;
#s/i3/&\#7989\;/g;
s/>\`i/&\#7986\;/g;
#s/i0\\/&\#7986\;/g;
#s/i2/&\#7986\;/g;
s/<\`i/&\#7987\;/g;
#s/i9\\/&\#7987\;/g;
#s/i4/&\#7987\;/g;
s/>\\\~i/&\#7990\;/g;
s/>\~i/&\#7990\;/g;
#s/i0\=/&\#7990\;/g;
#s/i\]/&\#7990\;/g;
s/<\\\~i/&\#7991\;/g;
s/<\~i/&\#7991\;/g;
#s/i9\=/&\#7991\;/g;
#s/i\[/&\#7991\;/g;
s/\\\"\'i/&\#8147\;/g;
s/\"\'i/&\#8147\;/g;
#s/i\+\//&\#8147\;/g;
#s/i5/&\#8147\;/g;
s/\\\"\`i/&\#8146\;/g;
s/\"\`i/&\#8146\;/g;
#s/i\+\\/&\#8146\;/g;
#s/i6/&\#8146\;/g;
s/\"\~i/&\#8151\;/g;
s/\\\"\~i/&\#8151\;/g;
s/\"\\\~i/&\#8151\;/g;
s/\\\"\\\~i/&\#8151\;/g;
#s/i\=\+/&\#8151\;/g;

s/\"i/&\#970\;/g;
s/\\\"i/&\#970\;/g;
s/\'i/&\#8055\;/g;
s/\`i/&\#8054\;/g;
s/\\\~i/&\#8150\;/g;
s/\~i/&\#8150\;/g;
s/>i/&\#7984\;/g;
#s/i0/&\#7984\;/g;
s/<i/&\#7985\;/g;
#s/i9/&\#7985\;/g;

s/>\'I/&\#7996\;/g;
#s/I\!/&\#7996\;/g;
s/<\'I/&\#7997\;/g;
#s/I\#/&\#7997\;/g;
#s/I\)\\/&\#7994\;/g;
#s/I\@/&\#7994\;/g;
s/<\`I/&\#7995\;/g;
#s/I\$/&\#7995\;/g;
s/>\\\~I/&\#7998\;/g;
s/>\~I/&\#7998\;/g;
#s/I\]/&\#7998\;/g;
s/<\\\~I/&\#7999\;/g;
s/<\~I/&\#7999\;/g;
#s/I\[/&\#7999\;/g;
s/\"I/&\#938\;/g;
s/\'I/&\#8155\;/g;
s/\`I/&\#8154\;/g;
s/>I/&\#7992\;/g;
s/<I/&\#7993\;/g;

s/>\'o/&\#8004\;/g;
#s/o0\//&\#8004\;/g;
#s/o1/&\#8004\;/g;
s/<\'o/&\#8005\;/g;
#s/o9\//&\#8005\;/g;
#s/o3/&\#8005\;/g;
s/>\`o/&\#8002\;/g;
#s/o0\\/&\#8002\;/g;
#s/o2/&\#8002\;/g;
s/<\`o/&\#8003\;/g;
#s/o9\\/&\#8003\;/g;
#s/o4/&\#8003\;/g;
s/\'o/&\#8057\;/g;
s/\`o/&\#8056\;/g;
s/>o/&\#8000\;/g;
#s/o0/&\#8000\;/g;
s/<o/&\#8001\;/g;
#s/o9/&\#8001\;/g;

s/>\'O/&\#8012\;/g;
#s/O\!/&\#8012\;/g;
s/<\'O/&\#8013\;/g;
#s/O\#/&\#8013\;/g;
s/>\`O/&\#8010\;/g;
#s/O\@/&\#8010\;/g;
s/<\`O/&\#8011\;/g;
#s/O\$/&\#8011\;/g;
s/\'O/&\#8185\;/g;
s/\`O/&\#8184\;/g;
s/>O/&\#8008\;/g;
s/<O/&\#8009\;/g;

s/>\'u/&\#8020\;/g;
#s/u0\//&\#8020\;/g;
#s/u1/&\#8020\;/g;
s/<\'u/&\#8021\;/g;
#s/u9\//&\#8021\;/g;
#s/u3/&\#8021\;/g;
s/>\`u/&\#8018\;/g;
#s/u0\\/&\#8018\;/g;
#s/u3/&\#8018\;/g;
s/<\`u/&\#8019\;/g;
#s/u9\\/&\#8019\;/g;
#s/u4/&\#8019\;/g;
s/>\\\~u/&\#8022\;/g;
s/>\~u/&\#8022\;/g;
#s/u0\=/&\#8022\;/g;
#s/u\]/&\#8022\;/g;
s/<\\\~u/&\#8023\;/g;
s/<\~u/&\#8023\;/g;
#s/u9\=/&\#8023\;/g;
#s/u\[/&\#8023\;/g;
s/\\\"\'u/&\#8163\;/g;
s/\"\'u/&\#8163\;/g;
#s/u\/\+/&\#8163\;/g;
s/\\\"\`u/&\#8162\;/g;
s/\"\`u/&\#8162\;/g;
#s/u\\\+/&\#8162\;/g;
s/\\\"\\\~u/&\#8167\;/g;
s/\"\~u/&\#8167\;/g;
s/\\\"\~u/&\#8167\;/g;
s/\"\\\~u/&\#8167\;/g;
#s/u\=\+/&\#8167\;/g;
s/\\\"u/&\#971\;/g;
s/\"u/&\#971\;/g;
s/\'u/&\#8059\;/g;
s/\`u/&\#8058\;/g;
s/\\\~u/\&\#8166\;/g;
s/\~u/\&\#8166\;/g;
s/>u/&\#8016\;/g;
#s/u0/&\#8016\;/g;
s/<u/\&\#8017\;/g;
#s/u9/\&\#8017\;/g;

s/<\'U/&\#8029\;/g;
#s/U\#/&\#8029\;/g;
s/<\`U/&\#8027\;/g;
#s/U\$/&\#8027\;/g;
s/<\\\~U/&\#8031\;/g;
s/<\~U/&\#8031\;/g;
#s/U\{/&\#8031\;/g;
s/\'U/&\#8171\;/g;
s/\`U/&\#8170\;/g;
s/\\\"U/&\#939\;/g;
s/\"U/&\#939\;/g;
s/<U/&\#8025\;/g;

s/>w\|/&\#8096\;/g;
#s/w0\|/&\#8096\;/g;
s/<w\|/&\#8097\;/g;
#s/w9\|/&\#8097\;/g;
s/>\'w\|/&\#8100\;/g;
#s/w0\/\|/&\#8100\;/g;
#s/w1\|/&\#8100\;/g;
s/<\'w\|/&\#8101\;/g;
#s/w3\|/&\#8101\;/g;
s/>\`w\|/&\#8098\;/g;
#s/w0\\\|/&\#8098\;/g;
#s/w2\|/&\#8098\;/g;
s/<\`w\|/&\#8099\;/g;
#s/w9\\\|/&\#8099\;/g;
#s/w4\|/&\#8099\;/g;
s/>\\\~w\|/&\#8102\;/g;
s/>\~w\|/&\#8102\;/g;
#s/w0\=\|/&\#8102\;/g;
#s/w\]\|/&\#8102\;/g;
s/<\\\~w\|/&\#8103\;/g;
s/<\~w\|/&\#8103\;/g;
#s/w9\=\|/&\#8103\;/g;
#s/w\[\|/&\#8103\;/g;
s/\'w\|/&\#8180\;/g;
s/\`w\|/&\#8178\;/g;
s/\\\~w\|/&\#8183\;/g;
s/\~w\|/&\#8183\;/g;
s/>\'w/&\#8036\;/g;
s/w\|/&\#8179\;/g;
#s/w0\//&\#8036\;/g;
#s/w1/&\#8036\;/g;
s/<\'w/&\#8037\;/g;
#s/w9\//&\#8037\;/g;
#s/w3/&\#8037\;/g;
s/>\`w/&\#8034\;/g;
#s/w0\\/&\#8034\;/g;
#s/w2/&\#8034\;/g;
s/<\`w/&\#8035\;/g;
#s/w4/&\#8035\;/g;
s/>\\\~w/&\#8038\;/g;
s/>\~w/&\#8038\;/g;
#s/w0\=/&\#8038\;/g;
#s/w\]/&\#8038\;/g;
s/<\\\~w/&\#8039\;/g;
s/<\~w/&\#8039\;/g;
#s/w9\=/&\#8039\;/g;
#s/w\[/&\#8039\;/g;
s/\'w/&\#8061\;/g;
s/\`w/&\#8060\;/g;
s/\\\~w/&\#8182\;/g;
s/\~w/&\#8182\;/g;
s/>w/&\#8032\;/g;
#s/w0/&\#8032\;/g;
s/<w/&\#8033\;/g;
#s/w9/&\#8033\;/g;

s/>W\|/&\#8104\;/g;
s/<W\|/&\#8105\;/g;
s/>\'W\|/&\#8108\;/g;
#s/W\!\|/&\#8108\;/g;
s/<\'W\|/&\#8109\;/g;
#s/W\#\|/&\#8109\;/g;
s/>W\|/&\#8106\;/g;
#s/W\@\|/&\#8106\;/g;
s/<\`W\|/&\#8107\;/g;
#s/W\$\|/&\#8107\;/g;
s/>\\\~W\|/&\#8110\;/g;
s/>\~W\|/&\#8110\;/g;
#s/W\]\|/&\#8110\;/g;
s/<\\\~W\|/&\#8111\;/g;
s/<\~W\|/&\#8111\;/g;
#s/W\[\|/&\#8111\;/g;
s/W\|/&\#8188\;/g;
s/>\'W/&\#8044\;/g;
s/>W/&\#8040\;/g;
s/<W/&\#8041\;/g;
s/>\'W/&\#8044\;/g;
s/<\'W/&\#8045\;/g;
#s/W\#/&\#8045\;/g;
s/>\`W/&\#8042\;/g;
#s/W\@/&\#8042\;/g;
s/<\`W/&\#8043\;/g;
#s/W\$/&\#8043\;/g;
s/>\\\~W/&\#8046\;/g;
s/>\~W/&\#8046\;/g;
#s/W\]/&\#8046\;/g;
s/<\\\~W/&\#8047\;/g;
s/<\~W/&\#8047\;/g;
#s/W\{/&\#8047\;/g;
s/\'W/&\#8187\;/g;
s/\`W/&\#8186\;/g;


s/a/\&\#945\;/g; 
s/b/\&\#946\;/g; 
s/g/\&\#947\;/g; 
s/d/\&\#948\;/g;
s/e/\&\#949\;/g; 
s/z/\&\#950\;/g; 
s/h/\&\#951\;/g; 
#s/j/\&\#952\;/g;
s/j/\&\#952\;/g;
s/i/\&\#953\;/g;
s/k/\&\#954\;/g;
s/l/\&\#955\;/g;
s/m/\&\#956\;/g;
s/n/\&\#957\;/g;
#s/x/\&\#958\;/g;
s/x/\&\#958\;/g;
s/o/\&\#959\;/g;
s/p/\&\#960\;/g;
s/r/\&\#961\;/g;
s/c/\&\#962\;/g;
s/s/\&\#963\;/g;
s/t/\&\#964\;/g;
s/u/\&\#965\;/g;
s/f/\&\#966\;/g;
#s/q/\&\#967\;/g;
s/q/\&\#967\;/g;
s/y/\&\#968\;/g;
s/w/\&\#969\;/g;
s/A/\&\#913\;/g;
s/B/\&\#914\;/g;
s/G/\&\#915\;/g;
s/D/\&\#916\;/g;
s/E/\&\#917\;/g;
s/Z/\&\#918\;/g;
s/H/\&\#919\;/g;
s/J/\&\#920\;/g;
s/I/\&\#921\;/g;
s/K/\&\#922\;/g;
s/L/\&\#923\;/g;
s/M/\&\#924\;/g;
s/N/\&\#925\;/g;
s/X/\&\#926\;/g;
s/O/\&\#927\;/g;
s/P/\&\#928\;/g;
s/R/\&\#929\;/g;
s/S/\&\#931\;/g;
s/T/\&\#932\;/g;
s/U/\&\#933\;/g;
s/F/\&\#934\;/g;
s/Q/\&\#935\;/g;
s/Y/\&\#936\;/g;
s/W/\&\#937\;/g;

s/\'\'/\&\#x1FBD\;/g;

s/\&/&amp\;/g;

print $_;

print '</pre>';

print $cgi->h3('<br><br>V&eacute;rification (en interpr&eacute;tant correctement unicode)&nbsp;:<br>');

s/\&amp\;/&/g;

print $_;

print '<p>(vous pouvez copier-coller ce r&eacute;sultat dans <em>Word</em>)</p>';

print '<br><br><center><a href="/babelgreek2unicode.html">Retour</a>';

print $cgi->end_html();
