Wierd character bug in PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael J Martin

    Wierd character bug in PHP?

    Found an interesting one today. I've been editing some code in the
    office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
    added an interesting character into my PHP source file.

    Initially I thought it was a bug somewhere in my code. But I didn't
    know about this hidden character until I viewed it as a phps file.





    http://projects.mike-martin.com/fecking_bug.php - error it returns
    http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
    file doesn't contain the character.

    Can anyone else reproduce it with the links I have just given?

    I'm hoping Apache doesn't cause it to go away. Now I've got to go back
    into all my code to see if it's crept in. I tried converting /
    reinterpreting Line Endings and Encoding types - even to ASCII in Coda
    but it still appears!

    I know it's probably an encoding issue but surely one like this
    shouldn't bring PHP down?

    Mike
  • Michael Fesser

    #2
    Re: Wierd character bug in PHP?

    ..oO(Michael J Martin)
    >Found an interesting one today. I've been editing some code in the
    >office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
    >added an interesting character into my PHP source file.
    >
    >Initially I thought it was a bug somewhere in my code. But I didn't
    >know about this hidden character until I viewed it as a phps file.
    >
    >http://projects.mike-martin.com/fecking_bug.phps
    >http://projects.mike-martin.com/fecking_bug.php.txt
    >
    >
    >http://projects.mike-martin.com/fecking_bug.php - error it returns
    >http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
    >file doesn't contain the character.
    >
    >Can anyone else reproduce it with the links I have just given?
    Yes. Question is where does it come from?
    >I'm hoping Apache doesn't cause it to go away. Now I've got to go back
    >into all my code to see if it's crept in. I tried converting /
    >reinterpreti ng Line Endings and Encoding types - even to ASCII in Coda
    >but it still appears!
    >
    >I know it's probably an encoding issue but surely one like this
    >shouldn't bring PHP down?
    The byte in question is 0x7F, which is the "DEL" control char:



    Obviously it shouldn't be there at all.

    Micha

    Comment

    • Jerry Stuckle

      #3
      Re: Wierd character bug in PHP?

      Michael J Martin wrote:
      Found an interesting one today. I've been editing some code in the
      office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
      added an interesting character into my PHP source file.
      >
      Initially I thought it was a bug somewhere in my code. But I didn't
      know about this hidden character until I viewed it as a phps file.
      >


      >
      >
      http://projects.mike-martin.com/fecking_bug.php - error it returns
      http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
      file doesn't contain the character.
      >
      Can anyone else reproduce it with the links I have just given?
      >
      I'm hoping Apache doesn't cause it to go away. Now I've got to go back
      into all my code to see if it's crept in. I tried converting /
      reinterpreting Line Endings and Encoding types - even to ASCII in Coda
      but it still appears!
      >
      I know it's probably an encoding issue but surely one like this
      shouldn't bring PHP down?
      >
      Mike
      >
      Mike,

      It is in your .gz file - on a line by itself between the $qsql= and the
      echo statements.

      Maybe try a different editor. It showed up perfectly in TextPad.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Erwin Moller

        #4
        Re: Wierd character bug in PHP?

        Jerry Stuckle schreef:
        Michael J Martin wrote:
        >Found an interesting one today. I've been editing some code in the
        >office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
        >added an interesting character into my PHP source file.
        >>
        >Initially I thought it was a bug somewhere in my code. But I didn't
        >know about this hidden character until I viewed it as a phps file.
        >>
        >http://projects.mike-martin.com/fecking_bug.phps
        >http://projects.mike-martin.com/fecking_bug.php.txt
        >>
        >>
        >http://projects.mike-martin.com/fecking_bug.php - error it returns
        >http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
        >file doesn't contain the character.
        >>
        >Can anyone else reproduce it with the links I have just given?
        >>
        >I'm hoping Apache doesn't cause it to go away. Now I've got to go back
        >into all my code to see if it's crept in. I tried converting /
        >reinterpreti ng Line Endings and Encoding types - even to ASCII in Coda
        >but it still appears!
        >>
        >I know it's probably an encoding issue but surely one like this
        >shouldn't bring PHP down?
        >>
        >Mike
        >>
        >
        Mike,
        >
        It is in your .gz file - on a line by itself between the $qsql= and the
        echo statements.
        >
        Maybe try a different editor. It showed up perfectly in TextPad.
        >
        TextPad Jerry?
        Great! My old favorite editor. :-)
        I thought I was the last man on Earth using it. ;-)

        Regards,
        Erwin Moller

        Comment

        • Michael J Martin

          #5
          Re: Wierd character bug in PHP?

          On Apr 8, 2:14 pm, Michael Fesser <neti...@gmx.de wrote:
          The byte in question is 0x7F, which is the "DEL" control char:
          >

          >
          Obviously it shouldn't be there at all.
          >
          Micha
          Interesting, I'll keep an eye on that. Maybe if I can reproduce it
          again whilst editing I'll send it to the Coda dev team. - I think it
          was Coda that was the culprit.

          So the question becomes subjective:
          FR: Shouldn't the PHP interpreter ignore 0x07F when interpreting?

          Comment

          • Jerry Stuckle

            #6
            Re: Wierd character bug in PHP?

            Erwin Moller wrote:
            Jerry Stuckle schreef:
            >Michael J Martin wrote:
            >>Found an interesting one today. I've been editing some code in the
            >>office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
            >>added an interesting character into my PHP source file.
            >>>
            >>Initially I thought it was a bug somewhere in my code. But I didn't
            >>know about this hidden character until I viewed it as a phps file.
            >>>
            >>http://projects.mike-martin.com/fecking_bug.phps
            >>http://projects.mike-martin.com/fecking_bug.php.txt
            >>>
            >>>
            >>http://projects.mike-martin.com/fecking_bug.php - error it returns
            >>http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
            >>file doesn't contain the character.
            >>>
            >>Can anyone else reproduce it with the links I have just given?
            >>>
            >>I'm hoping Apache doesn't cause it to go away. Now I've got to go back
            >>into all my code to see if it's crept in. I tried converting /
            >>reinterpretin g Line Endings and Encoding types - even to ASCII in Coda
            >>but it still appears!
            >>>
            >>I know it's probably an encoding issue but surely one like this
            >>shouldn't bring PHP down?
            >>>
            >>Mike
            >>>
            >>
            >Mike,
            >>
            >It is in your .gz file - on a line by itself between the $qsql= and
            >the echo statements.
            >>
            >Maybe try a different editor. It showed up perfectly in TextPad.
            >>
            >
            TextPad Jerry?
            Great! My old favorite editor. :-)
            I thought I was the last man on Earth using it. ;-)
            >
            Regards,
            Erwin Moller
            >
            Naw, Erwin, it's one of the editors I use, mainly for quick and dirty
            stuff. I prefer Crimson for programming (actually Eclipse is better but
            a bit buggy). But sometimes, like this, the simpler the better :-)

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Jerry Stuckle

              #7
              Re: Wierd character bug in PHP?

              Michael J Martin wrote:
              On Apr 8, 2:14 pm, Michael Fesser <neti...@gmx.de wrote:
              >
              >The byte in question is 0x7F, which is the "DEL" control char:
              >>
              >http://www.fileformat.info/info/unic...007f/index.htm
              >>
              >Obviously it shouldn't be there at all.
              >>
              >Micha
              >
              Interesting, I'll keep an eye on that. Maybe if I can reproduce it
              again whilst editing I'll send it to the Coda dev team. - I think it
              was Coda that was the culprit.
              >
              So the question becomes subjective:
              FR: Shouldn't the PHP interpreter ignore 0x07F when interpreting?
              >
              No, PHP doesn't ignore any character - just like every other language,
              every character counts. As it should be.

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Erwin Moller

                #8
                Re: Wierd character bug in PHP?

                Jerry Stuckle schreef:
                Erwin Moller wrote:
                <snip>
                >TextPad Jerry?
                >Great! My old favorite editor. :-)
                >I thought I was the last man on Earth using it. ;-)
                >>
                >Regards,
                >Erwin Moller
                >>
                >
                Naw, Erwin, it's one of the editors I use, mainly for quick and dirty
                stuff. I prefer Crimson for programming (actually Eclipse is better but
                a bit buggy). But sometimes, like this, the simpler the better :-)
                Hi Jerry,

                TextPad is a great program, but I don't use it either for PHP
                programming. I prefer Zend Studio (5.5) at the moment, but am
                considering their Eclipse port.

                I feel a bit had by Zend. When I bought Zend Studio, they promised me a
                lifetime of free upgrades, only to start their new line in Eclipse right
                away, for which I have to pay of course.
                Bad Zend, seems they are in it for the money. ;-)

                Regards,
                Erwin

                Comment

                • Jerry Stuckle

                  #9
                  Re: Wierd character bug in PHP?

                  Erwin Moller wrote:
                  Jerry Stuckle schreef:
                  >Erwin Moller wrote:
                  >
                  <snip>
                  >
                  >>TextPad Jerry?
                  >>Great! My old favorite editor. :-)
                  >>I thought I was the last man on Earth using it. ;-)
                  >>>
                  >>Regards,
                  >>Erwin Moller
                  >>>
                  >>
                  >Naw, Erwin, it's one of the editors I use, mainly for quick and dirty
                  >stuff. I prefer Crimson for programming (actually Eclipse is better
                  >but a bit buggy). But sometimes, like this, the simpler the better :-)
                  >
                  Hi Jerry,
                  >
                  TextPad is a great program, but I don't use it either for PHP
                  programming. I prefer Zend Studio (5.5) at the moment, but am
                  considering their Eclipse port.
                  >
                  I feel a bit had by Zend. When I bought Zend Studio, they promised me a
                  lifetime of free upgrades, only to start their new line in Eclipse right
                  away, for which I have to pay of course.
                  Bad Zend, seems they are in it for the money. ;-)
                  >
                  Regards,
                  Erwin
                  >
                  Yea, I almost bought Zend studio. Glad I didn't, now.

                  Of course, they said "lifetime updates" - but they didn't say WHOSE
                  lifetime... :-)


                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Piotr

                    #10
                    Re: Wierd character bug in PHP?

                    >TextPad is a great program, but I don't use it either for PHP
                    >programming. I prefer Zend Studio (5.5) at the moment, but am
                    >considering their Eclipse port.
                    >>
                    >I feel a bit had by Zend. When I bought Zend Studio, they promised me
                    >a lifetime of free upgrades, only to start their new line in Eclipse
                    >right away, for which I have to pay of course.
                    >Bad Zend, seems they are in it for the money. ;-)
                    >>
                    >Regards,
                    >Erwin
                    >>
                    >
                    Yea, I almost bought Zend studio. Glad I didn't, now.
                    >
                    Of course, they said "lifetime updates" - but they didn't say WHOSE
                    lifetime... :-)
                    >
                    >
                    There will be Netbeans powered PHP first alpha released in about one month.

                    best regards
                    Piotr N

                    Comment

                    • Piotr

                      #11
                      Re: Wierd character bug in PHP?

                      Piotr wrote:
                      >>TextPad is a great program, but I don't use it either for PHP
                      >>programming . I prefer Zend Studio (5.5) at the moment, but am
                      >>considering their Eclipse port.
                      >>>
                      >>I feel a bit had by Zend. When I bought Zend Studio, they promised me
                      >>a lifetime of free upgrades, only to start their new line in Eclipse
                      >>right away, for which I have to pay of course.
                      >>Bad Zend, seems they are in it for the money. ;-)
                      >>>
                      >>Regards,
                      >>Erwin
                      >>>
                      >Yea, I almost bought Zend studio. Glad I didn't, now.
                      >>
                      >Of course, they said "lifetime updates" - but they didn't say WHOSE
                      >lifetime... :-)
                      >>
                      >>
                      >
                      There will be Netbeans powered PHP first alpha released in about one month.
                      >
                      best regards
                      Piotr N
                      ofc, I ment PHP IDE

                      Comment

                      • Erwin Moller

                        #12
                        Re: Wierd character bug in PHP?

                        Piotr schreef:
                        Piotr wrote:
                        >>>TextPad is a great program, but I don't use it either for PHP
                        >>>programmin g. I prefer Zend Studio (5.5) at the moment, but am
                        >>>considerin g their Eclipse port.
                        >>>>
                        >>>I feel a bit had by Zend. When I bought Zend Studio, they promised me
                        >>>a lifetime of free upgrades, only to start their new line in Eclipse
                        >>>right away, for which I have to pay of course.
                        >>>Bad Zend, seems they are in it for the money. ;-)
                        >>>>
                        >>>Regards,
                        >>>Erwin
                        >>>>
                        >>Yea, I almost bought Zend studio. Glad I didn't, now.
                        >>>
                        >>Of course, they said "lifetime updates" - but they didn't say WHOSE
                        >>lifetime... :-)
                        >>>
                        >>>
                        >There will be Netbeans powered PHP first alpha released in about one month.
                        >>
                        >best regards
                        >Piotr N
                        ofc, I ment PHP IDE
                        Netbeans goes PHP?
                        Wow!

                        I liked Netbeans a lot more than Eclipse for my Java Projects.
                        Not to mention Eclipse was horribly slow on my old development machine.

                        Personally, I thought of Eclipse as overly complex compared to Netbeans,
                        but that could very well be just me.

                        I'll keep an eye on it. :-)

                        Thanks for the news.

                        Regards,
                        Erwin Moller

                        Comment

                        • Jerry Stuckle

                          #13
                          Re: Wierd character bug in PHP?

                          Piotr wrote:
                          >>TextPad is a great program, but I don't use it either for PHP
                          >>programming . I prefer Zend Studio (5.5) at the moment, but am
                          >>considering their Eclipse port.
                          >>>
                          >>I feel a bit had by Zend. When I bought Zend Studio, they promised me
                          >>a lifetime of free upgrades, only to start their new line in Eclipse
                          >>right away, for which I have to pay of course.
                          >>Bad Zend, seems they are in it for the money. ;-)
                          >>>
                          >>Regards,
                          >>Erwin
                          >>>
                          >Yea, I almost bought Zend studio. Glad I didn't, now.
                          >>
                          >Of course, they said "lifetime updates" - but they didn't say WHOSE
                          >lifetime... :-)
                          >>
                          >>
                          >
                          There will be Netbeans powered PHP first alpha released in about one month.
                          >
                          best regards
                          Piotr N
                          >
                          Hmmm, now that would be good! Netbeans is really good for Java.

                          --
                          =============== ===
                          Remove the "x" from my email address
                          Jerry Stuckle
                          JDS Computer Training Corp.
                          jstucklex@attgl obal.net
                          =============== ===

                          Comment

                          • Piotr

                            #14
                            Re: Wierd character bug in PHP?

                            Jerry Stuckle wrote:
                            >
                            Hmmm, now that would be good! Netbeans is really good for Java.
                            >
                            Well.. in fact one of it's dev team members asked the question about
                            "what are our expectations from 'best' PHP IDE" few days ago on polish
                            PHP group.
                            I have some experience with Eclipse and Zend Studio, so shared my view
                            from that perspective, but if you have some more info, i guess it
                            wouldn't be bad to mail the guy with suggestions.

                            He posted as tomslot(at)gmai l.com,
                            web: http://wiki.netbeans.org/PHP

                            best regards
                            Piotr N

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: Wierd character bug in PHP?

                              Piotr wrote:
                              Jerry Stuckle wrote:
                              >Hmmm, now that would be good! Netbeans is really good for Java.
                              >>
                              Well.. in fact one of it's dev team members asked the question about
                              "what are our expectations from 'best' PHP IDE" few days ago on polish
                              PHP group.
                              I have some experience with Eclipse and Zend Studio, so shared my view
                              from that perspective, but if you have some more info, i guess it
                              wouldn't be bad to mail the guy with suggestions.
                              >
                              He posted as tomslot(at)gmai l.com,
                              web: http://wiki.netbeans.org/PHP
                              >
                              best regards
                              Piotr N
                              >
                              Not knowing what they're planning, it's hard to make suggestions. But
                              if they do the same things that NetBeans is doing currently in Java, it
                              should be great.

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...