Web Analytics Made Easy -
StatCounter Encoding issue - CodingForum

Announcement

Collapse
No announcement yet.

Encoding issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Encoding issue

    Hi I am having an encoding issue. I have no idea how encoding works within PHP but I am finding different areas are using differenet encoding. The problem occurs when I try to test to string variables and they are returing differnet results. When I echo them to the browesr they look the same. Its only when I individually break down the strings and return the ord() values do I see a difference. What i am finding is that the session string is UTF-8 and the associative array is ASCII.
    You can not say you know how to do something, until you can teach it to someone else.

  • #2
    Use: base64_encode & base64_decode

    Comment


    • #3
      PHP doesn't fully support UTF8 (at least not before PHP6). When you have UTF8 strings some string functions will stop working for example strlen() will give incorrect lenghts.
      You could check out the manual on the iconv extension to check how to convert strings to a desired encoding.
      I'm not sure if this was any help, but I hope it didn't make you stupider.

      Experience is something you get just after you really need it.
      PHP Installation Guide Feedback welcome.

      Comment


      • #4
        If set everything to UTF-8 even in the html and the
        mb_internal_encoding("UTF-8");
        mb_http_output( "UTF-8" );
        everything should be in UTF-8 ive tried encoding to utf-8. I tried the base64encode etc etc

        This whole situation makes as much sense as this

        PHP Code:
        dfdafskadjl jsdfbhksdfh jdsf
        sdf fjdsl vkj
        'B JFSVB
        dflsj ;sdG 
        SDG fjvklJA BLKhgS 
        SEg gvbj ;ladfhvO' 
        VJADVL;B
        SDF jvlVJN 
        @
        You can not say you know how to do something, until you can teach it to someone else.

        Comment


        • #5
          Originally posted by marek_mar View Post
          PHP doesn't fully support UTF8 (at least not before PHP6). When you have UTF8 strings some string functions will stop working for example strlen() will give incorrect lenghts.
          You could check out the manual on the iconv extension to check how to convert strings to a desired encoding.
          Ill check it now
          You can not say you know how to do something, until you can teach it to someone else.

          Comment

          Working...
          X