farsi language auto-detection in web pages

2005-08-09 Thread mohsen ali momeni
Hi,

How can I auto-detect language of a webpage without knowing it's
charset? (suppose language and charset is not defined in header)
Is there a simple (not time-consuming) method to detect a page charset?

Regards,







-- 
__ \ /_\\_-//_ Mohsen A. Momeni
/\_\\_/\_/_/  Software Developer @ rcii-ir.org
 __\ _ /_ www.momeni.us.tc

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


Re: Date data type in MySQL

2005-06-06 Thread mohsen ali momeni
 Hi,
 
 I was wondering how Date data type is dealt with in such databases
 as PostgreSQL or mySQL?
 
 Databases usually have Date related operations such as equality,
 less than, greater than, etc . But most databases have the Gregorian
 Calendar and not Jalalian.
 
 Any solutions or hacks?

Jalali calender is not implemented in MySQL yet. But MySQL doesn't
check the validity of Date entered. I mean you can enter any date
having day part from 1 to 31. So Jalali Date can be saved in Date data
type of MySQL. Also operations such as equality or .. works fine with
it. The only problem is the Add_Date, Sub_Date and functions like that
which doesn't work for Persian Date. A Multi-Calender system for MySQL
is going to be developed in near future (probably by me) so if you
need the full functionality, you should wait till then.

Regards,

-- 
__ \ /_\\_-//_ Mohsen A. Momeni
 __\ _ /_ www.momeni.us.tc

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


Re: PersianComputing Digest, Vol 23, Issue 2

2005-04-15 Thread mohsen ali momeni
Hi !

 hi every one i have a problem in mysql data base
 is that
 when i reveiw my table cotained data in PhpMyAdmin in
 persian i can see and edit data correctly but when i
 use
 my script to query my tables using PHP it display my
 table data as a '?' (question marks)
 i am using
 mysql server 4.1;
 php4.xx and utf-8 encoding in my pages.
 OS:Win2000 server.
 Regards
 zarbizade.

make a query to get your session variables, check whether the server ,
client and *connection* character set is utf8.
note that you should create the database or the table by utf8 charset
or set the variables related to charset to utf8 while getting the utf8
entered data.

for more information:
http://projects.farsilinux.org/projects/mysqlproject/
you can download the related documents form mostanadaat:
http://projects.farsilinux.org/docman/view.php/21/47/End%20User%20Support%20Matrtials.pdf


 
 ___
 PersianComputing mailing list
 PersianComputing@lists.sharif.edu
 http://lists.sharif.edu/mailman/listinfo/persiancomputing
 
 End of PersianComputing Digest, Vol 23, Issue 2
 ***
 


-- 
__ \ /_\\_-//_ Mohsen A. Momeni
/\_\\_/\_/_/  Software Developer @ rcii-ir.org
 __\ _ /_ www.momeni.us.tc

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


Re: PersianComputing Digest, Vol 21, Issue 13

2005-02-25 Thread mohsen ali 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.

Well, at first I wanted to implement a multicalender system for mysql
through a variable per column that can be set while creating tables,
something like : Create table t0 (dt Date calender jalali) ;  but as
mysql didn't accept , I worked on some functions.Now, I save iranian
Date in Date data type of mysql so why can't i define JDateAdd and
JDateDiff for iranian Date ??

Of course you are right , I shouldn't implement all Date functions
again but don't we need DateDiff function?
Maybe I misunderestood what you are saying , sorry.

Regards,
Mohsen A. Momeni
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


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

2005-02-22 Thread mohsen ali momeni
 Hi ,

 I talked to Roozbeh Pournader about your mail.  Seems like you
 are using an old version of the code, which has the problem as
 you mentioned.  Our latest code is available from address below
 and doesn't have that problem:

 http://www.farsiweb.info/jalali/jalali.c

Thanks for your attention.
I will apply this new algorithm now and will send a patch again to
mysql in the hope they accept it.

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
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 21, Issue 5

2005-02-16 Thread mohsen ali momeni
Hello,

About jalali or Iranian calender, i think fighting about what the name
should be is of no use and will make a lot of problems for us. I know
everything about them. that Jalali calender is based on calculation
and iranian calender has a astoronomical basis. But all these
arguments will lead to our failiur for having a standard calender in
iran.
I have added Jalali (Persian , Iranian , ) calender to MySQL as a
set of functions having J at the beginnig of each of them. But I think
developers of mysql has read all these arguments in mailing lists and
may decided to forget about the patch as I have got no aswer till now.

I think we have one target and that is having jalali (or ...) calender
in our databases NO MATTER WHAT THE NAME IS.
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 17, Issue 8

2004-10-31 Thread mohsen ali momeni
 Salaam,
 As I know begining from Mysql 4.1 it support persion sort. And this
 not need any patch.

No , its not so .MySQL 4.1 uses cp1256 charset as default charset for
persian data manipulation. The sort , search doesn't work correctly in
cp1256.
The mysql project team worked on adding UTF-8 support for persian
language.This includes , storage , sort ,search and other operations
for persian language.

 
 Regards,
 Sadeq
 
 On Sat, 23 Oct 2004 20:37:39 +0800, zilinex [EMAIL PROTECTED] wrote:

I have answered this before .The patch you have written is a
correction for sorting of persian language in cp1256 charset.Anyway
cp1256 is arabic not persian.This project is to give persian support
in UTF-8 charset for MySQL.

  salaam
  anyone here can give me some useful information about the
  Frasi Mysql project leaded by Manafi?...
  http://www.itna.ir/archives/news/001428.php
  and some info about the project?
  I've wrote some patches enble sortting farsi data before
  and I'm eager to know more about others doing this.
  my patches was made on mysql-3.23.48 - 3.23.52
  it has no compelexity and I can wrote these patches in a few days.
  ( it was somewhat hard to sort UTF-8 data )...
  you can see one of the results in the current url (server is rh8):
  http://materials.iut.ac.ir/congress/register/ (user: administrator , password: 
  adminpass please don't change any data)
  ... now I want to know more about the farsi Mysql project and their achivements.
  Mehdi Adibi
  kind regards
___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Persian numbers in Glibc

2004-09-11 Thread mohsen ali momeni
Hello everyone,

Does Glibc support persian numbers? i mean does it interpret persian
numbers as real numbers?
As i tested ,it's not so , i mean there is no support for persian
numbers in glibc.am i right?

Is there any application in linux supporting persian numbers?Should
this support be added to any application that is supposed to support
persian language?

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


tarjome be farsi

2004-09-06 Thread mohsen ali momeni
salam be hame doostan

aya kalamate mo'tabar (ke hame estefade mikonan) baraye tarjomeye
kalamati mese locale,wide character,multibyte character va ...
dar zabane farsi vojood dare? inaro va kalamate shabih be ino chi
tarjome mikonan?

age linki darin ke inaro hame ba ham dare mamnoon misham befrestin 
mamnoon 
bye
___
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing