jphp
jphp copied to clipboard
Use the `b` flag in fopen to write/read BinaryMemory strings
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).
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.
Data conversion between BinaryMemory and StringMemory occurs automatically if necessary.
If a function works with binary data, it must use the Memory.getBinaryBytes(env) method.