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

Let std::string and char * casters also accept bytes #23

Closed
wants to merge 1 commit into from

Conversation

inducer
Copy link

@inducer inducer commented Apr 7, 2022

I don't quite know whether I like this. Ideally, we'd be able to tell from C++ whether something is intended to be UTF-8 or not. (Maybe an argument attribute? An entirely separate type?) Examples where this is relevant include Unix filenames (bytes, not really UTF-8). I encountered it for passing compiler options to OpenCL's clBuildProgram, where any implicit encoding change is a risk.

Still to do:

  • Add some tests

@inducer inducer marked this pull request as draft April 7, 2022 23:45
@inducer inducer changed the title Let std::string and char * casters also accept bytes Let std::string and char * casters also accept bytes Apr 7, 2022
@wjakob
Copy link
Owner

wjakob commented Apr 8, 2022

Humm, I don't think I like this one -- probably more in the territory of a custom type caster that you could define in your project.

@wjakob wjakob force-pushed the master branch 2 times, most recently from b6837e0 to 13dbff1 Compare May 29, 2022 22:01
@wjakob wjakob closed this May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants