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

Source Files contain Unicode Text #2706

Closed
perhapsmaple opened this issue Jun 18, 2024 · 1 comment · Fixed by #2707
Closed

Source Files contain Unicode Text #2706

perhapsmaple opened this issue Jun 18, 2024 · 1 comment · Fixed by #2707
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@perhapsmaple
Copy link
Contributor

Describe your environment

Branch: main (commit 25738f3)

Steps to reproduce

find . -type f -name "*.h" -exec file {} \; | grep UTF-8
find . -type f -name "*.cc" -exec file {} \; | grep UTF-8

What is the expected behavior?
Source files are expected to be ASCII encoded except when unicode characters are required for tests.

What is the actual behavior?

harish@Harishs-MacBook-Air opentelemetry-cpp % find . -type f -name "*.h" -exec file {} \; | grep UTF-8  
./api/include/opentelemetry/context/context.h: C++ source text, Unicode text, UTF-8 (with BOM) text
./api/include/opentelemetry/context/runtime_context.h: C++ source text, Unicode text, UTF-8 (with BOM) text
./api/include/opentelemetry/baggage/baggage.h: C++ source text, Unicode text, UTF-8 (with BOM) text

harish@Harishs-MacBook-Air opentelemetry-cpp % find . -type f -name "*.cc" -exec file {} \; | grep UTF-8
./ext/test/http/url_parser_test.cc: c program text, Unicode text, UTF-8 text
./sdk/test/metrics/instrument_metadata_validator_test.cc: c program text, Unicode text, UTF-8 text
./opentracing-shim/src/span_shim.cc: C++ source text, Unicode text, UTF-8 text

Additional context
The headers listed above all have a BOM character at the start of the file, and span_shim.cc has a unicode character in a comment. I currently use an in-house build system that is built on flex which has trouble parsing UTF-8 encoded files. I think we should convert all source files to use ASCII encoding unless required. I would be happy to contribute a PR if required.

@perhapsmaple perhapsmaple added the bug Something isn't working label Jun 18, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 18, 2024
@marcalff
Copy link
Member

Thanks for the report. PR welcome.

@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants