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

gherkin: (C) Manually convert uri:s from char* to wchar_t*. #176

Merged
merged 2 commits into from
Apr 2, 2017

Conversation

brasmusson
Copy link
Contributor

Summary

Manually convert uri:s from char* to wchar_t* to work around the deficient implementation of swprintf on Alpine Linux 3.5 running in Docker. Fixes #165.

Details

On Alpine Linux 3.5 running in Docker swprintf does not handle the format string L"%hs" properly and the written string becomes empty, therefore swprintf cannot be used to convert the uri:s passed as argument (as char*) to wide characters (wchar_t*). To work around this the uri:s are converted manually character by character, taking into account that the uri is utf8 coded (which only make a difference if the uri contains non-ascii characters).

How Has This Been Tested?

Tested on the Docker image, and on Ubuntu 16.04 (gcc and clang).

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • Tested by the acceptance test (was: I've added tests for my code).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

brasmusson and others added 2 commits April 2, 2017 18:37
On Alpine Linux 3.5 running in Docker swprintf does not handle the
format string L"%hs" properly and the written string becomes empty,
therefore swprintf cannot be used to convert the uri:s passed as
argument (as char*) to wide characters (wchar_t*). To work around this
the uri:s are converted manually character by character, taking into
account that the uri is utf8 coded (which only make a difference if the
uri contains non-ascii characters).
@aslakhellesoy
Copy link
Contributor

Awesome work @brasmusson! I had hoped this would fix #168 too, but it seems not. You think it's related?

@brasmusson brasmusson deleted the gherkin-c-fix-docker-build branch May 1, 2017 18:21
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gherkin C tests fail on Alpine Linux
2 participants