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.