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...
Continue reading...