How to display Arabic language on a webpage

Source: Internet
Author: User

I remember my previous interview with MicrosoftProgramThe interviewer asked how to display an Arabic webpage. We know that the display method of Arabic web pages is right-to-left and right-aligned. Since we didn't have access to such a page at the time, we really don't know how to implement it.
Today, I finally learned (it's too embarrassing, so late to know), but I still want to show off the shortcomings. Please give pointers.

Generally, Chinese or English operating systems are used in China. To display Arabic web pages, we need to create Web applications that support two-way languages.
1. To display Arabic web pages, of course, Arabic language packs are indispensable. Otherwise, how can I enter Arabic. (Haha, this sentence seems like nonsense .)

2. Use ASP. NET's important regional support (Culture and uiculture) to set the date, number, and currency formats related to the region, and uiculture to set the resources to be loaded. The two can be set through web. config and programming methods. Note that if you want to set a culture through programming, You need to override the initializeculture method. For details about other methods, refer to Microsoft's msdn.

3. Encoding Problems. ASP. NET processes all texts as Unicode. You can set the responseencoding, requestencoding, and fileencoding attributes of the globalization element of Web. config. By default, UTF-8 encoding is used.

4. Key issues from right to left. The above points are about how to set Arabic encoding. This is the key to how to set the Dir attribute during HTML writing from right to left. Dir attributes include: LTR (default, displayed from left to right) and RTL (displayed from right to left ). To display data from right to left, set the Dir attribute to rtl in the <HTML> or <body> tag. Then I suddenly realized that it was easy to do it.

These are my personal ideas and I hope you will criticize and correct them.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.