HTML - Arabic Support

后端 未结 8 2260
情书的邮戳
情书的邮戳 2020-11-27 03:15

i have a website in which i have to put some lines in Arabic.... how to do it...

where to get the Arabic text characters... how to make the page support Arabic...

相关标签:
8条回答
  • 2020-11-27 03:46

    Check you have <meta charset="utf-8"> inside head block.

    0 讨论(0)
  • 2020-11-27 03:47

    If you don't even know where to get Arabic characters, but you want to display them, then you're doing something wrong.

    Save files containing Arabic characters with encoding UTF-8. A good editor allows you to set the character encoding. In the HTML page, place the following after <head>:

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    

    If you're using XHTML:

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    

    That's it.

    An alternative way (without messing with the encoding of a file), is using HTML escape sequences. This website does that jobs for you: http://www.htmlescape.net/

    0 讨论(0)
  • 2020-11-27 03:50

    The W3C has a good introduction.

    In short:

    HTML is a text markup language. Text means any characters, not just ones in ASCII.

    1. Save your text using a character encoding that includes the characters you want (UTF-8 is a good bet). This will probably require configuring your editor in a way that is specific to the particular editor you are using. (Obviously it also requires that you have a way to input the characters you want)
    2. Make sure your server sends the correct character encoding in the headers (how you do this depends on the server software you us)
    3. If the document you serve over HTTP specifies its encoding internally, then make sure that is correct too
    4. If anything happens to the document between you saving it and it being served up (e.g. being put in a database, being munged by a server side script, etc) then make sure that the encoding isn't mucked about with on the way.

    You can also represent any unicode character with ASCII

    0 讨论(0)
  • 2020-11-27 03:50

    As mentioned above, by default text editors will not use UTF-8 as the standard encoding for documents. However most editors will allow you to change that in the settings. Even for each specific document.

    0 讨论(0)
  • 2020-11-27 03:52

    You not only have to put the meta tag, telling that it is UTF-8 but really make the document UTF-8. You can do that with good editors (like notepad++) by converting them to "unicode" or "UTF-8 without BOM". Than you can simply use arabic characters

    As this page is UTF-8, here are some examples (I hope I don't write anything rude here): شغف

    If you use a server side scripting language make sure that it does not output the page in a different encoding. In PHP e.g. you can set it like this:

    header('Content-Type: text/html; charset=utf-8');
    
    0 讨论(0)
  • 2020-11-27 04:04

    i edit the html page with notepad ++ ,set encoding to utf-8 and its work

    0 讨论(0)
提交回复
热议问题