persian

Persian Calender in MVC , Asp.net

断了今生、忘了曾经 提交于 2019-12-03 08:20:49
I use a DateTime variable in MVC and I want to show Persian calender for @Html.EditorFor(x=> x.ProductionDate) How can I do it? Ahmad I found the solution 1.Go to www.amib.ir/weblog/?page_id=316 and download the latest version of "AMIB_jsPersianCal" 2.Add "js-persian-cal.min.js" and "js-persian-cal.css" and "pcal.png" to your project you can change the css for specified the Url of PNG file 3.Add the css and js file to your cshtml file <link href="@Url.Content("~/Content/js-persian-cal.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/js-persian-cal.min.js")"><

How to Convert Persian Digits in variable to English Digits Using Culture?

心已入冬 提交于 2019-12-03 06:42:02
问题 I want to change persian numbers which are saved in variable like this : string Value="۱۰۳۶۷۵۱"; to string Value="1036751"; How can I use easy way like culture info to do this please? my sample code is: List<string> NERKHCOlist = new List<string>(); NERKHCOlist = ScrappingFunction(NERKHCO, NERKHCOlist); int NERKHCO_Price = int.Parse(NERKHCOlist[0]);//NERKHCOlist[0]=۱۰۳۶۷۵۱ <= So it can not Parsed it to int And This is in my function which retun a list with persian digits inside list items

Why words are shuffled when I insert English words in any Arabic/Urdu/Persian text on Notepad or MS Word?

别等时光非礼了梦想. 提交于 2019-12-03 05:39:25
问题 I can write Arabic/Urdu/Persian on MS Word or Notepad just fine, but whenever I insert any English word or number, the sequence is just disturbed and seems like the all the words have been shuffled in the sentence. Look at the example below: یہ ایک مثال ہے اردو کی ... Now I inserted an English word and it became: یہ ایک مثال ہےword اردو کی ... So you can see almost all of the words have been jumbled ... what is the solution for that ? 回答1: For example: باللغة العربية “keyboard” انا أريد أن

persian/arabic search in sqlite android gives bad result

眉间皱痕 提交于 2019-12-03 05:25:12
i have a problem with sqlite database. it seems to not support full persian/arabic characters. when i search some fields based on persian chars, most of the times Sqlite can't recognize those chars. i insert data into database by copy them from HTML file. so when i type string and search, no result show. but if i copy string and search, it works. The string from the HTML file is: "احكام خمس" The typed string is: "احکام خمس" These strings are different. The HTML string begins with the characters U+0627, U+062D, and U+0643 (Alef, Hah, and Kaf). The third character of the typed string is not U

How to Convert Persian Digits in variable to English Digits Using Culture?

谁说胖子不能爱 提交于 2019-12-02 20:19:25
I want to change persian numbers which are saved in variable like this : string Value="۱۰۳۶۷۵۱"; to string Value="1036751"; How can I use easy way like culture info to do this please? my sample code is: List<string> NERKHCOlist = new List<string>(); NERKHCOlist = ScrappingFunction(NERKHCO, NERKHCOlist); int NERKHCO_Price = int.Parse(NERKHCOlist[0]);//NERKHCOlist[0]=۱۰۳۶۷۵۱ <= So it can not Parsed it to int And This is in my function which retun a list with persian digits inside list items protected List<string> ScrappingFunction(string SiteAddress, List<string> NodesList) { string Price =

How to convert Persian and Arabic numbers inside a string to English using JavaScript?

荒凉一梦 提交于 2019-11-30 18:18:01
How can I convert Persian/Arabic numbers to English numbers with a simple function? arabicNumbers = ["١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩", "٠"] persianNumbers = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"] It is the same schema, but the code pages are different. Use this simple function to convert your string var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g], arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g], fixNumbers = function (str) { if(typeof str === 'string') { for(var i=0; i<10; i++) { str = str.replace

How convert Gregorian date to Persian date?

本小妞迷上赌 提交于 2019-11-30 06:04:58
I want to convert a custom Gregorian date to Persian date in C#. For example, i have a string with this contents: string GregorianDate = "Thursday, October 24, 2013"; Now i want to have: string PersianDate = پنج‌شنبه 2 آبان 1392 ; or string PersianDate = 1392/08/02 Thanks Use the PersianCalendar: string GregorianDate = "Thursday, October 24, 2013"; DateTime d = DateTime.Parse(GregorianDate); PersianCalendar pc = new PersianCalendar(); Console.WriteLine(string.Format("{0}/{1}/{2}", pc.GetYear(d), pc.GetMonth(d), pc.GetDayOfMonth(d))); You can use PersianDateTime: PM> Install-Package

using preg_match to detect persian (farsi) characters in string

自古美人都是妖i 提交于 2019-11-30 05:08:42
I am trying to validate form data from server-side. my interest is that the user just fill the form by Persian characters. I am using this code: $name=trim($_POST['name']); $name= mysql_real_escape_string($name); if (preg_match('/^[\u0600-\u06FF]+$/',str_replace("\\\\","",$name))){$err.= "Please use Persian characters!";} but it is not working! here is a warning: Warning: preg_match() [function.preg-match]: Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 3 in C:\xampp\htdocs\site\form.php on line 38 What can I do? This 'should' work... ** added a ^ after the opening [

.NET How to parse a Persian / Farsi date string (Jalali calendar) into a DateTime object?

回眸只為那壹抹淺笑 提交于 2019-11-30 03:50:18
I've run across several great code libraries for converting a Persian (Jalali calendar) date to a Gregorian date. However, my original source is a string, not a DateTime object. There doesn't seem to be official support in the .NET framework for parsing dates using the Persian calendar (if I'm wrong, please show me!). My goal: string persianDateString="1390/02/07"; DateTime persianDateTime = MyPersianParser.Parse(persianDateString, "yyyy/mm/dd"); And of course, some dates may use word names for months and days of the week, so I'd like to be able to support the standard format string protocol.

How to convert Persian and Arabic numbers inside a string to English using JavaScript?

好久不见. 提交于 2019-11-29 12:45:07
问题 How can I convert Persian/Arabic numbers to English numbers with a simple function? arabicNumbers = ["١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩", "٠"] persianNumbers = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"] It is the same schema, but the code pages are different. 回答1: Use this simple function to convert your string var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g], arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],