Professional Web Applications Themes

[PHP] Is PHP cable of handling ASCII characters??? - PHP Development

[snip] Is PHP cable of handling the ASCII characters? Back then, I had no problem with it when there are 'a', 'b', 'c' characters as well as 'LF', 'CR', etc. But when there is a 'NUL' character, it tripped up PHP so I am wondering if ASCII characters is fully supported. [/snip] How is the NUL tripping up PHP? Are you streaming something?...

  1. #1

    Default RE: [PHP] Is PHP cable of handling ASCII characters???

    [snip]
    Is PHP cable of handling the ASCII characters? Back then, I had no
    problem with it when there are 'a', 'b', 'c' characters as well as 'LF',
    'CR', etc. But when there is a 'NUL' character, it tripped up PHP so I
    am
    wondering if ASCII characters is fully supported.
    [/snip]

    How is the NUL tripping up PHP? Are you streaming something?
    Jay Blanchard Guest

  2. #2

    Default RE: [PHP] Is PHP cable of handling ASCII characters???

    [snip]
    Yea, receiving the data in a serial stream through cURL from someplace
    into
    an array() by using exec() function.
    [/snip]

    I would suggest receiving the data intact, explode into an array, and
    then go from there. That eliminates any serialization issue.
    Jay Blanchard Guest

  3. #3

    Default Re: [PHP] Is PHP cable of handling ASCII characters???

    Yea, receiving the data in a serial stream through cURL from someplace into
    an array() by using exec() function.

    "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    news:C8F323573C030A448F3E5A2B6FE2070B0101FA68neme sis...
    [snip]
    Is PHP cable of handling the ASCII characters? Back then, I had no
    problem with it when there are 'a', 'b', 'c' characters as well as 'LF',
    'CR', etc. But when there is a 'NUL' character, it tripped up PHP so I
    am
    wondering if ASCII characters is fully supported.
    [/snip]

    How is the NUL tripping up PHP? Are you streaming something?


    Scott Fletcher Guest

  4. #4

    Default Re: [PHP] Is PHP cable of handling ASCII characters???

    I don't see how. The data when recevied is already in pieces through the
    exec() to PHP which convert the PHP variable into an array. Can not store
    the data into a file on the machine because it is illegal to do so.
    >"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    >news:C8F323573C030A448F3E5A2B6FE2070B0101FA6Bnem esis...
    >[snip]
    >Yea, receiving the data in a serial stream through cURL from someplace
    >into
    >an array() by using exec() function.
    >[/snip]
    >
    >I would suggest receiving the data intact, explode into an array, and
    >then go from there. That eliminates any serialization issue.

    Scott Fletcher Guest

  5. #5

    Default Re: [PHP] Is PHP cable of handling ASCII characters???

    Yea, cURL can handle ASCII characters. It been working for a couple of
    years. The first clipping is a sample PHP code. The 2nd clipping is the
    result of the data in ASCII characters, most of the data inside the CDATA is
    removed for security reason. The 3rd clipping is the result of a PHP array
    when in use, again some data is removed for security reason also. As you
    can see from the array, it showed the PHP array stopped storing data when
    the 'NUL' value is reached.

    --snip--
    exec(CURL_CMD." -m 120 -u \"$XP_BASIC_AUTH\" -d \"$XML_REQ_STR\"
    ".$URL, $xp_result_array, $res_code);
    -- snip--

    --snip--
    0000000 < ? x m l sp v e r s i o n = " 1

    0000020 . 0 " sp s t a n d a l o n e = "

    0000040 n o " ? > < N e t C o n n e c t

    0000060 R e s p o n s e sp x m l n s = "

    0000100 h t t p : / / w w w . e x p e r

    0000120 i a n . c o m / N e t C o n n e

    0000140 c t R e s p o n s e " > < C o m

    0000160 p l e t i o n C o d e > 0 0 0 0

    0000200 < / C o m p l e t i o n C o d e

    0000220 > < H o s t R e s p o n s e > <

    0000240 ! [ C D A T A [ cr lf cr lf cr lf cr lf

    0000260 cr lf cr lf cr lf cr lf P A G E sp 1 sp sp

    0000300 sp D A T E sp sp 8 - 0 7 - 2 0 0 3

    0000320 sp sp T I M E sp sp 9 : 0 0 : 2 8 sp

    0001540 sp sp sp sp cr lf cr lf sp E N D sp - - sp

    0001560 E X P E R I A N sp C O D E cr lf nul

    0001600 ] ] > < / H o s t R e s p o n s

    0001620 e > < / N e t C o n n e c t R e

    0001640 s p o n s e >

    0001647

    --snip--

    --snip--
    Array ( [0] => 0000 [2] => [3] => [4] => [5] => [6] => [7] => [8] => PAGE 1
    DATE 8-08-2003 TIME 16:32:35 V001 [22] => END -- EXPERIAN CODE )
    --snip--

    "Curt Zirzow" <curtzirzow.dyndns.org> wrote in message
    news:20030808211407.GE21938bagend.shire...
    > * Thus wrote Scott Fletcher (scottabcoa.com):
    > > Yea, receiving the data in a serial stream through cURL from someplace
    into
    > > an array() by using exec() function.
    >
    > PHP is in general can handle binary strings, now if cURL can
    > handle it is a different story. Of course I'm stabbing in the dark
    > at to what your problem is. Can you give an example of 'tripped up'
    > is?
    >
    >
    > Curt
    > --
    > "I used to think I was indecisive, but now I'm not so sure."

    Scott Fletcher Guest

Similar Threads

  1. replacing characters with their ASCII codes
    By daniel kaplan in forum PERL Modules
    Replies: 1
    Last Post: August 21st, 08:43 AM
  2. non ASCII characters in text column
    By rkusenet in forum Informix
    Replies: 2
    Last Post: November 17th, 01:46 PM
  3. Is PHP cable of handling ASCII characters???
    By Scott Fletcher in forum PHP Development
    Replies: 0
    Last Post: August 8th, 08:51 PM
  4. [PHP] Formatting an ascii characters in php?
    By Jay Blanchard in forum PHP Development
    Replies: 1
    Last Post: August 8th, 07:41 PM
  5. Formatting an ascii characters in php?
    By Scott Fletcher in forum PHP Development
    Replies: 0
    Last Post: August 8th, 07:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139