[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: PHP and Progress 4GL

  • Thread starter Thread starter bronco
  • Start date Start date
Status
Not open for further replies.
B

bronco

Guest
when you do: SET-SIZE(mptr) = LENGTH(inputString) + 1. PUT-STRING(mptr, 1) = inputString. You have add 1 to the length or the string will not fit and then it's zero terminated. That's where the "AA==" is coming from. Instead of adding 1 to the size you can restrict the amount of bytes written to the memptr by: SET-SIZE(mptr) = LENGTH(inputString). PUT-STRING(mptr, 1, LENGTH(inputString, "RAW")) = inputString. Then you get the same output as Java, PHP, etc... note: the "RAW" parameter with the length function should be used when using multi-byte codepages (i.e. utf-8).

Continue reading...
 
Status
Not open for further replies.
Back
Top