Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danog opened this issue Mar 10, 2020 · 3 comments
Open

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

danog opened this issue Mar 10, 2020 · 3 comments
Labels

Comments

@danog
Copy link

danog commented Mar 10, 2020

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).

@dim-s
Copy link
Member

dim-s commented Mar 10, 2020

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
Copy link
Member

dim-s commented Mar 10, 2020

Data conversion between BinaryMemory and StringMemory occurs automatically if necessary.

@dim-s
Copy link
Member

dim-s commented Mar 10, 2020

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

@dim-s dim-s added the question label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants