set text while english and persian is together

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oranoos3000
    New Member
    • Jan 2009
    • 107

    set text while english and persian is together

    hi
    i have an forum that user can insert your question or answer
    i d like to user can insert english or persian (persian is a unicode character or farsi character)chara cter
    but problem is not this
    my problem is that while i fetch this text from database
    place of text character is changed
    you see result of this on
    http://www.infoiran.ir
    thanks alot
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    What do you mean by: "place of text character is changed"?
    I can't really see a problem with the Persian text the page that you posted. It looks fine to me. Not that I actually know how the Persian text is supposed to look like.

    Comment

    • oranoos3000
      New Member
      • Jan 2009
      • 107

      #3
      hi
      for example i insert a persian text and then insert english sequent and arragement . i d like to user can insert persian text and english text together
      when i save this text to database this text is saved correctly
      but when i fetch this text from database and i d like to show this text to page
      this text is distured and place of persian text and english text is disturbed
      thanks alot

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        I'm still not following.

        It sounds to me like you want to use both Persian and English text together, but have both align correctly. Meaning; English from left to right, and Persian from right to left.

        Is that it?

        HTML allows two attributes: lang and dir.
        "lang" defines the language in which the contents of the tag is written in, while "dir" defines the direction of the text ("rtl" or "ltr").

        So, you could do:
        [code=html]
        <p lang="en" dir="ltr">
        Some English text
        </p>
        <p lang="fa" dir="rtl">
        Some Persian text. Farsi, as I understand it is called.
        </p>[/code]

        The first block would be rendered from left-to-right using English fonts, while the bottom block would be rendered right-to-left using fonts tailored to Persian.
        I understand there are some rendering differences between them and the Arabic fonts. This helps the browser decide which to use.

        Not sure if this is exactly a solution to your problem tho.
        If it is not, please explain in more detail. Perhaps you could show us example code? Maybe the HTML output of the page that is not being displayed correctly.

        Comment

        Working...