Encode characters above ASCII 255

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    Encode characters above ASCII 255

    If I need to encode characters below ASCII value 32, I can use this:[php]$text = filter_var($tex t, FILTER_UNSAFE_R AW, FILTER_FLAG_ENC ODE_LOW);[/php]
    How can I encode characters above ASCII value 256?
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, hsriat.

    For what medium are you encoding them?

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Hey pbmods,

      Thanks for replying mate..

      I figured this out later. It wasn't a problem with PHP encoding, but JavaScript encoding.
      While posting something, if the user would include special characters like √, π, α, β, γ, δ, η... in his post, these characters would turn into the question mark things.

      So this was the problem. But its completely out of my mind how did I come up with this question. Just, you know when thing are not working, you try even those things which don't have any relation.

      So the actual reason was, while posting the text through Ajax, I was doing escape(), but it had to be encodeURICompon ent().


      Regards,
      Harpreet

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, Harpreet.

        Glad you were able to get it working! Good luck with your project.

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          Originally posted by pbmods
          Good luck with your project.
          Thank you

          Comment

          Working...