Title: Fix for Gherkin's localization · Issue #63 · cpp-testing/GUnit · GitHub
Open Graph Title: Fix for Gherkin's localization · Issue #63 · cpp-testing/GUnit
X Title: Fix for Gherkin's localization · Issue #63 · cpp-testing/GUnit
Description: I try to use .feature files with the language option and found 2 bugs. In GSteps.h need use "type" not "keyword" because "keyword" contains localized word. std::string keyword = children["type"]; The function read_data in GUnit/Detail/Fi...
Open Graph Description: I try to use .feature files with the language option and found 2 bugs. In GSteps.h need use "type" not "keyword" because "keyword" contains localized word. std::string keyword = children["type"]; T...
X Description: I try to use .feature files with the language option and found 2 bugs. In GSteps.h need use "type" not "keyword" because "keyword" contains localized word. std::string...
Opengraph URL: https://github.com/cpp-testing/GUnit/issues/63
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix for Gherkin's localization","articleBody":"I try to use .feature files with the language option and found 2 bugs.\r\n1. In GSteps.h need use \"type\" not \"keyword\" because \"keyword\" contains localized word.\r\n` std::string keyword = children[\"type\"];`\r\n2. The function read_data in GUnit/Detail/FileUtils.h read chars from utf8 files.\r\nI fixed this bug using UnicodeUtilities_read_code_point_from_utf8_source from gherkin-c library.\r\n\r\n```\r\nextern \"C\" {\r\ntypedef struct Utf8Source Utf8Source;\r\nlong UnicodeUtilities_read_code_point_from_utf8_source(Utf8Source* utf8_source);\r\nUtf8Source* FileUtf8Source_new(FILE* file);\r\nunsigned char Utf8Source_read(Utf8Source* utf8_source);\r\nvoid Utf8Source_delete(Utf8Source* utf8_source);\r\n}\r\n\r\ninline std::wstring read_file(const std::string \u0026feature) {\r\n FILE* file = fopen(feature.c_str(), \"rb\");\r\n if (!file) {\r\n throw std::runtime_error(\"File \\\"\" + feature + \"\\\" not found!\");\r\n }\r\n std::wstring r;\r\n Utf8Source* utf8_source = FileUtf8Source_new(file);\r\n for(;;) {\r\n long code = UnicodeUtilities_read_code_point_from_utf8_source(utf8_source);\r\n if (code == WEOF) break;\r\n r+=(wchar_t)code;\r\n }\r\n Utf8Source_delete(utf8_source);\r\n fclose(file);\r\n return r;\r\n}\r\n\r\n```\r\n\r\n","author":{"url":"https://github.com/demidovsursu","@type":"Person","name":"demidovsursu"},"datePublished":"2021-08-12T03:19:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63/GUnit/issues/63"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8bf6c58e-d61d-6dd7-1126-4568a231f4c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E98:242A7E:26CD8:36613:696F7830 |
| html-safe-nonce | 2a18b72058021cb391908821a3b636fab63b71ee974af42592d5190d0fbdca60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTk4OjI0MkE3RToyNkNEODozNjYxMzo2OTZGNzgzMCIsInZpc2l0b3JfaWQiOiI4MTA5Mzg4ODc5MzIxMDY5NjE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3fea53b03c7e78bddca8229a729796f4af3e1440ad516c352999db45e07c940f |
| hovercard-subject-tag | issue:967932730 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cpp-testing/GUnit/63/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ead5d3927982ad5ea3a056750d8d66ca214f19c4829948e6819e6d5bbeeafde3/cpp-testing/GUnit/issues/63 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ead5d3927982ad5ea3a056750d8d66ca214f19c4829948e6819e6d5bbeeafde3/cpp-testing/GUnit/issues/63 |
| og:image:alt | I try to use .feature files with the language option and found 2 bugs. In GSteps.h need use "type" not "keyword" because "keyword" contains localized word. std::string keyword = children["type"]; T... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | demidovsursu |
| hostname | github.com |
| expected-hostname | github.com |
| None | acc7f8c2e144976eeb6e7a73826049dd183bc572ccf5eaa9afb8265c617a97ab |
| turbo-cache-control | no-preview |
| go-import | github.com/cpp-testing/GUnit git https://github.com/cpp-testing/GUnit.git |
| octolytics-dimension-user_id | 24781083 |
| octolytics-dimension-user_login | cpp-testing |
| octolytics-dimension-repository_id | 77401922 |
| octolytics-dimension-repository_nwo | cpp-testing/GUnit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 77401922 |
| octolytics-dimension-repository_network_root_nwo | cpp-testing/GUnit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cc546a224d6d4726a8d7c3a0dfe0cf65dbf9b7bd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width