jphp icon indicating copy to clipboard operation
jphp copied to clipboard

Use the `b` flag in fopen to write/read BinaryMemory strings

Open danog opened this issue 5 years ago • 3 comments

As per title. A very useful feature would be to force usage of BinaryMemory strings instead of UTF-16 strings in the entire JPHP environment (with a flag).

danog avatar Mar 10 '20 12:03 danog

The binary memory is always used for this. The f... functions was implemented via the Stream classes which use for read and write operation binary memory. So there is no difference between binary data and text.

dim-s avatar Mar 10 '20 13:03 dim-s

Data conversion between BinaryMemory and StringMemory occurs automatically if necessary.

dim-s avatar Mar 10 '20 13:03 dim-s

If a function works with binary data, it must use the Memory.getBinaryBytes(env) method.

dim-s avatar Mar 10 '20 13:03 dim-s