ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <gip.bilotta@iol.it>
Subject: Re[4]: Arabic-utf-8 (plus a sample)
Date: Sun, 6 Jun 2004 01:58:44 +0200	[thread overview]
Message-ID: <424260277.20040606015844@iol.it> (raw)
In-Reply-To: <opr85abbiwu9mfh0@lamar.colostate.edu>

Sunday, June 6, 2004 Idris Samawi Hamid wrote:

> Hi Giuseppe (Is it not way past your bedtime;->),

Yes it is, and it shows. But since I'm up and not having any
particular urge to go to bed in this very moment, here's a
tested alternative that works here:

==
#!/usr/bin/perl

use strict;
use warnings;

open(NEW,">new.tex"); #opens file to print out the result

while (<>) { #this opens the file for reading

$_ =~ s/\xD8\xA7/A/g; #this is the actual conversion
$_ =~ s/\xD8\xA8/b/g; #this is the actual conversion
$_ =~ s/\xD8\xAC/j/g; #this is the actual conversion
$_ =~ s/\xD8\xAF/d/g; #this is the actual conversion
$_ =~ s/\xD9\x87/h/g; #this is the actual conversion
$_ =~ s/\xD9\x88/w/g; #this is the actual conversion
$_ =~ s/\xD8\xB2/z/g; #this is the actual conversion

print NEW "$_"; #and this writes the result into file "new.tex"
}

close(NEW);
===

to be used as

utf2tex filename

If you want to add more conversions, open your unicode file in
an hex editor and check the actual byte-per-byte hex value of
the utf text for the other characters you want to add. This
should be enough for your needs.

-- 
Giuseppe "Oblomov" Bilotta

  reply	other threads:[~2004-06-05 23:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-05 19:32 Idris Samawi Hamid
2004-06-05 20:41 ` Thomas A. Schmitz
2004-06-05 21:33   ` Idris Samawi Hamid
2004-06-05 21:48     ` Thomas A. Schmitz
2004-06-05 22:51       ` Idris Samawi Hamid
2004-06-05 23:15         ` Re[2]: " Giuseppe Bilotta
2004-06-05 23:31           ` Idris Samawi Hamid
2004-06-05 23:58             ` Giuseppe Bilotta [this message]
2004-06-06  0:19               ` Re[4]: " Idris Samawi Hamid
2004-06-06  0:26                 ` Idris Samawi Hamid
2004-06-06  9:09                 ` Perl scripting (was: Arabic-utf-8) Henning Hraban Ramm
2004-06-06 21:03                   ` Idris Samawi Hamid
2004-06-06 21:28                     ` Thomas A. Schmitz
2004-06-07 19:45                       ` Henning Hraban Ramm
2004-06-07 20:53                         ` Thomas A.Schmitz
2004-06-05 23:08 ` [SPAM: 3.411] Arabic-utf-8 (plus a sample) Richard MAHONEY
2004-06-06  0:19   ` Idris Samawi Hamid
2004-06-06 13:22 ` Arabic-utf-8 " George N. White III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=424260277.20040606015844@iol.it \
    --to=gip.bilotta@iol.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).