Re: [farsiweb]unicode fields in database
On Sat, 9 Nov 2002, FK wrote: All these problems with the Arabic script makes me a believer in changing our alphabet to a Latin-based one and getting rid of all these unnecessary headaches :-) The whole point is: all other languages have similiar problems, including those written in Latin. The main difference, is usually that there is not enough market for Persian abilities in software. Just some examples: Swedish sorts 'v' and 'w' as one letter. Turkish and Azeri have different capitalization rules than the other languages, since they have two different 'i's. Slovak treats 'ch' as a single letter sorted between 'c' and 'd'. Hungarian sorts 'czz' as it were 'czcz'. French needs a ligated 'oe' letter, which does not even exist in ISO-8859-1, ... IMHO, the Latin script will not solve the problems, it just adds another complexity dimension. roozbeh ___ FarsiWeb mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/farsiweb
Re: [farsiweb]unicode fields in database
ON SAT NOVEMBER 9 2002 [EMAIL PROTECTED] WROTE: Still, I'm curious. How come everyone on this discussion board is using the Latin alphabet? :-) Well, most discussions here are also in English. Should everyone in Iran switch over to English? Going back to the original point, would you explain how switching to the Latin alphabet solves the Farsi text sorting problem in a database? ___ FarsiWeb mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/farsiweb
Re: [farsiweb]unicode fields in database
As far as I can tell, you HTML doesn't have any notion of fields. If you mean the letters Peh, Gaf, Farsi Yeh, etc, they can be referenced in HTML pages as "#x"+hexcode+";". Farsi Yeh becomes "#x06cc;", for example.OK I knew this, but I want to know when we want to represent a database unicode field in an ASP page(finally an HTML formatted page) is any more efficient way than converting them dynamically from Unicode to HTML entity code. I'm sorry I don't know ASP. But you can also use UTF-8 in your HTML page and encode the Persian letters as two bytes. Farsi Yeh becomes 0xDB 0x8C, for example. roozbeh ASP works very well while using unicode fields in SQL Server. Use following style for your asp page to make your page in UTF-8 . No conversion is needed to use. The most important part is the first line.The output of this ASP page will be like as Roozbeh said . It will not use "#x"+hexcode+";" style. %@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%html lang="fa" dir="rtl" headmeta http-equiv="Content-Type" content="text/html; charset=utf-8"/head % Response.Write(put your database field here) % body /body/html Best Regards Jalal Abedinejad
Re: [farsiweb]unicode fields in database
On Fri, 8 Nov 2002, Nasiri2 wrote: Do you use Persian unicode fields in any database? How do you sort these fields while the letters Gaf,Cheh,Peh, and Zheh are not in correct order? Your database or your programming language should provide the sorting mechanism, or you should implement sorting yourself (as a database engine plug-in if it supports it, or in the programming language if it doesn't). We already have solutions for C, PHP, and PostgreSQL, but all are Linux-only, or possibly Cygwin (port of GNU tools to Windows). How do you represent these fields in HTML or ASP pages (converting them to HTML entity code dynamically, saving their entity codes, or whatever else)? As far as I can tell, you HTML doesn't have any notion of fields. If you mean the letters Peh, Gaf, Farsi Yeh, etc, they can be referenced in HTML pages as #x+hexcode+;. Farsi Yeh becomes #x06cc;, for example. roozbeh ___ FarsiWeb mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/farsiweb
Re: [farsiweb]unicode fields in database
Hamid Rezâye gerâmi: Man bâ "unicode" kâr nakardeam vali tavânestam bâ bekâr bordane: META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256" dar safheye xod, bâ tâyp kardan be Pârsi az bânke "MYSQL" estefâde konam. In kâr besyâr sâde anjâm od. Mitavânid barâye mesâl be safheye zir negâh bekonid: http://iranianlanguages.com/dictionary.php?eng-per Sepâsmandam, Dr. Zurvân ILS
Re: [farsiweb]unicode fields in database
I guess for sorting you would just need to write a few lines of code. It would not be too difficult. - Original Message - From: Naqashzade, Sadeq To: Zurvan Sent: Thursday, November 07, 2002 5:27 PM Subject: Re: [farsiweb]unicode fields in database Salaam, What about persian sort? is it correct? I use Unicode. I can do search and show texts using MySQL but my problem in correct sort. You can see the example in www.YazdIndustry.com that is a directory of Yazd Industrials that is under construction now but some things is ready. Regards Sadeq - Original Message - From: Zurvan To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, November 09, 2002 10:56 PM Subject: Re: [farsiweb]unicode fields in database Hamid Rezâye gerâmi: Man bâ "unicode" kâr nakardeam vali tavânestam bâ bekâr bordane: META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256" dar safheye xod, bâ tâyp kardan be Pârsi az bânke "MYSQL" estefâde konam. In kâr besyâr sâde anjâm od. Mitavânid barâye mesâl be safheye zir negâh bekonid: http://iranianlanguages.com/dictionary.php?eng-per Sepâsmandam, Dr. Zurvân ILS
Re: [farsiweb]unicode fields in database
I took a look at your site (YazdIndustry.com). Very impressive. Do you require sorting when displaying the results ofa search? I know MySQL does not sometimes, for example, distinguish between letters with diactritics and the ones without, like  and A or â and a.What I have doneto make sure MySQL does not makethese kinds of mistakes is to save the Persian words in 2 different ways. One using the 1256 format and the other using a regular font. This way when youdo asearch for a word you will have to check 2 entries if needed.Forsorting you could use the font entries since they aremostly inASCII characters. All these problems with the Arabic script makes mea believer in changing our alphabet to a Latin-based one and getting rid of all these unnecessary headaches :-) Dr. Z. - Original Message - From: Naqashzade, Sadeq To: FK Sent: Thursday, November 07, 2002 6:22 PM Subject: Re: [farsiweb]unicode fields in database No it is not. this is not PHP problem, I think it is MySQL problem that not support unicode. You can write a simple code to select the rows but never you will get soreted result in right order :-( I did not test it on Windows Server. But I test it with ARABIC and UNICODE encoding both. and failed to get what I want :(( Bests, Sadeq Naqashzade [EMAIL PROTECTED] - Original Message - From: FK To: Naqashzade, Sadeq ; [EMAIL PROTECTED] Sent: Sunday, November 10, 2002 8:20 AM Subject: Re: [farsiweb]unicode fields in database I guess for sorting you would just need to write a few lines of code. It would not be too difficult. - Original Message - From: Naqashzade, Sadeq To: Zurvan Sent: Thursday, November 07, 2002 5:27 PM Subject: Re: [farsiweb]unicode fields in database Salaam, What about persian sort? is it correct? I use Unicode. I can do search and show texts using MySQL but my problem in correct sort. You can see the example in www.YazdIndustry.com that is a directory of Yazd Industrials that is under construction now but some things is ready. Regards Sadeq - Original Message - From: Zurvan To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, November 09, 2002 10:56 PM Subject: Re: [farsiweb]unicode fields in database Hamid Rezâye gerâmi: Man bâ "unicode" kâr nakardeam vali tavânestam bâ bekâr bordane: META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256" dar safheye xod, bâ tâyp kardan be Pârsi az bânke "MYSQL" estefâde konam. In kâr besyâr sâde anjâm od. Mitavânid barâye mesâl be safheye zir negâh bekonid: http://iranianlanguages.com/dictionary.php?eng-per Sepâsmandam, Dr. Zurvân ILS