Re: PersianComputing Digest, Vol 21, Issue 6 (fwd)

2005-02-24 Thread Skip Tavakkolian
 On Wed, 23 Feb 2005, mohsen ali momeni wrote:
 
 Now something else ,
 For AddDate and DateDiff functions, I need an algorithm which
 calculates the number of leap years between two given Date. Is there
 any such algorithm or at least a documentation for the above
 algorithms (jalali.c) so that i can find it in the code myself? (Or
 AddDate, DateDiff functions ready in ideal case)

 Regards,
 Mohsen A. Momeni
 
 Well, that's why I'm saying your implementation is not what MySQL
 people expect.  The date data type is representation-agnostic
 itself, and AddDate, DateDiff, etc work with the date data type
 (at least in MySQL).  What you need is functions to covert from
 internal date representation to Iranian calendar string, and vice
 versa.  You don't need (and should not) implement all date
 functions again.
 
 
 --behdad
 http://behdad.org/


I'm not sure how the date data type can be representation agnostic.
What ever the OS provides (via a system call) is in reference to a
starting point in some calendar.  On UNIX systems, this is
traditionally the number of seconds since January 1, 1970, i.e.
Gregorian.  GetSystemTime on Win32 returns a structure, which
represents the Gregorian date.

___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: Persian numbers in Glibc

2004-09-12 Thread Skip Tavakkolian
  Does Glibc support persian numbers? 
  
  Yes. This is what 'I' flag defined for.  (see printf manual part 3)
  You can change your '%d' and '%f'  with '%Id' and '%If' in printf
  parameters like this:
  
  printf (%Id, 12345);
  
  And you will see Persian digits if you set you locale to fa_IR.
 
 If think you wanted to say %lc -- the length modifier l is applied to
 char type:
 
 printf(%lc, 0x06f3);   // arabic-indic digit 3
 
 No. I exactly meant 'I' flag which does what he wants.
 Check printf man page part 3 and look for 'Arabic' or 'Persian'. 

I see. The font I use shows lower case 'L' the same as upper case 'I'.
For what it is worth, according to ISO C99, if __STDC_ISO_10646__
macro is defined, you can use the l (lower case 'L') modifier for
char (%c) format to print a UNICODE char:

Is the upper case i (eye) for printf in the ISO C standard?

glibc 2.2 adds one further flag character.

I   For decimal integer conversion (i, d, u)  the  output  uses  the
locale's  alternative output digits, if any.  For example, since
glibc 2.2.3 this will give Arabic-Indic digits  in  the  Persian
(`fa_IR') locale.


___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: Using of U+066C as a number-separator

2004-01-11 Thread Skip Tavakkolian
BTW, what would the use of Reh instead of proper chars like U+066C or
U+066B do to sort orders or parsing of numeric vs. alphabetic sequences?
For example, a function persian_ispunct()  la ANSI C ispunct()
would then have to include Reh as a possible punctuation character.

 On Sun, 2004-01-11 at 15:47, AmirBehzad Eslami wrote:
 I wonder even the Nesf2 has a bug about this U+066C.
 
 Nesf2 is deprecated, as far as the original author (Hooman Mehr), its
 porter to Unicode (Mehran Mehr) and the latest maintainers (FarsiWeb)
 are concerned. There are currently no plan to support it.
 
 Is there an alternative for me? May I use the 'Reh' until most of users have
 standard systems?
 
 Reh is definitely very ambiguous, specially since it's confusable with
 the more common Iran University Press usage of it for the decimal
 separator.
 
 Use may comma or apostrophe or something like that.
 
 2. Ask my website visitors to download a newer version of Tahoma (What about
 the font Nesf?)
 
 Tahoma makes sense. Alternatively, tell them to download FarsiWeb fonts.
 
 B) What is this Arabic Decimal Separator (U+066B)?
 
 That is the momayyez.
 
 roozbeh

___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: IranSystem to Unicode (UTF-8) converter

2004-01-03 Thread Skip Tavakkolian
I've include the man page for tcs utility in Plan9 OS. Would something
like this do what you want?  If so, I'll post the instructions on how
to get the sources to this list.

Tcs has been ported to Posix environments like BSD, Linux, Cygwin (for
Windows)

-Fariborz


 TCS(1) TCS(1)

 NAME
  tcs - translate character sets

 SYNOPSIS
  tcs [ -slcv ] [ -f ics ] [ -t ocs ] [ file ... ]

 DESCRIPTION
  Tcs interprets the named file(s) (standard input default) as
  a stream of characters from the ics character set or format,
  converts them to runes, and then converts them into a stream
  of characters from the ocs character set or format on the
  standard output.  The default value for ics and ocs is utf,
  the UTF encoding described in utf(6). The -l option lists
  the character sets known to tcs. Processing continues in the
  face of conversion errors (the -s option prevents reporting
  of these errors).  The -c option forces the output to con-
  tain only correctly converted characters; otherwise, 0x80
  characters will be substituted for UTF encoding errors and
  0xFFFD characters will substituted for unknown characters.

  The -v option generates various diagnostic and summary
  information on standard error, or makes the -l output more
  verbose.

  Tcs recognizes an ever changing list of character sets.  In
  particular, it supports a variety of Russian and Japanese
  encodings.  Some of the supported encodings are

  utfThe Plan 9 UTF encoding, known by ISO as UTF-8
  utf1   The deprecated original UTF encoding from ISO
 10646
  ascii  7-bit ASCII
  8859-1 Latin-1 (Central European)
  8859-2 Latin-2 (Czech .. Slovak)
  8859-3 Latin-3 (Dutch .. Turkish)
  8859-4 Latin-4 (Scandinavian)
  8859-5 Part 5 (Cyrillic)
  8859-6 Part 6 (Arabic)
  8859-7 Part 7 (Greek)
  8859-8 Part 8 (Hebrew)
  8859-9 Latin-5 (Finnish .. Portuguese)
  koi8   KOI-8 (GOST 19769-74)
  jis-kanji  ISO 2022-JP
  ujis   EUC-JX: JIS 0208
  ms-kanji   Microsoft, or Shift-JIS
  jis(from only) guesses between ISO 2022-JP, EUC or
 Shift-Jis
  gb Chinese national standard (GB2312-80)
  big5   Big 5 (HKU version)
  unicodeUnicode Standard 1.0

 Page 1   Plan 9  (printed 1/3/04)

 TCS(1) TCS(1)

  tisThai character set plus ASCII (TIS 620-1986)
  msdos  IBM PC: CP 437
  atari  Atari-ST character set

 EXAMPLES
  tcs -f 8859-1
   Convert 8859-1 (Latin-1) characters into UTF format.

  tcs -s -f jis
   Convert characters encoded in one of several shift JIS
   encodings into UTF format.  Unknown Kanji will be con-
   verted into 0xFFFD characters.

  tcs -lv
   Print an up to date list of the supported character
   sets.

 SOURCE
  /sys/src/cmd/tcs

 SEE ALSO
  ascii(1), rune(2), utf(6).

 Page 2   Plan 9  (printed 1/3/04)
---BeginMessage---



Salam,
I'm looking for IranSystem to Unicode(UTF-8) converter. If you 
have one or interested to develop one for me , please tell me.

Regards,
Ebadat A.R.
___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing
---End Message---
___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: [PersianComputing] Koodak font: alpha release

2003-08-08 Thread Skip Tavakkolian
 I see. That's nice if it works.

It works; witness: Linux, FreeBSD, NetBSD, XWindows, Apache, Cygwin, Perl,
MySQL,  to name a few.

To be entirely accurate some of the above are GPL, which eventhough
puts no restrictions on commercial exploitation, requires the derived work
to be GPL also.

-Fariborz

___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: [PersianComputing] Re: My radical discovery.

2002-11-19 Thread Skip Tavakkolian
 There is a nice (and recent) slide presentation
 Couldn't find slideshow. Please provide URL.

http://farsitex.sourceforge.net/tug2002/ftexslides.pdf

 I don't mean any offense to you personally.

none taken.

___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing