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

[php] examples/strings.php has a BOM--files cannot have BOM!! #4038

Closed
kaby76 opened this issue Apr 1, 2024 · 1 comment
Closed

[php] examples/strings.php has a BOM--files cannot have BOM!! #4038

kaby76 opened this issue Apr 1, 2024 · 1 comment
Labels

Comments

@kaby76
Copy link
Contributor

kaby76 commented Apr 1, 2024

The templates for testing do not consider BOM in a file input. All files cannot have BOM. php/examples/strings.php contains a BOM. For TypeScript, the file is opened and read via readFileSync() into a string. That should have gotten rid of the BOM but it does not. The encoding parameter is "utf-8", but it does not automatically handle BOM. Instead, it considers it as a character. What a lovely language TypeScript/JavaScript is----NOT!!!

I can fix this file, but for future problems, the templates need to cut this BS out. NO BOM!!!!

https://stackoverflow.com/questions/33977843/how-to-detect-if-a-file-has-a-utf-8-bom-in-bash

kaby76 added a commit to kaby76/grammars-v4 that referenced this issue Apr 1, 2024
teverett pushed a commit that referenced this issue Apr 1, 2024
* Port php grammar to Antlr4ng.

* Fix for #4037 and #4038
@kaby76
Copy link
Contributor Author

kaby76 commented Apr 1, 2024

Fixed with #4039

@kaby76 kaby76 closed this as completed Apr 1, 2024
@KvanTTT KvanTTT added the php label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants