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

Unable to add copyright to file with UTF-8 characters #42

Open
colindean opened this issue Apr 23, 2018 · 5 comments
Open

Unable to add copyright to file with UTF-8 characters #42

colindean opened this issue Apr 23, 2018 · 5 comments
Labels

Comments

@colindean
Copy link
Contributor

I've got a couple of Rust source files (added syntax in #41) with the non-ASCII character for ellipses:. copyright-header doesn't seem to like that:

SKIP src/logging.rs; invalid byte sequence in US-ASCII
SKIP src/update.rs; detected existing license
SKIP src/main.rs; invalid byte sequence in US-ASCII

It's not a huge deal for us because it's only two files but I'm sure others might hit this at some point. I can't quite tell from the error where in the process the file is being opened as US-ASCII.

@colindean
Copy link
Contributor Author

I think the problem is here, where perhaps the syntax file needs to be able to define the expected encoding of the source files.

It may be safe to hardcode as UTF-8, since ASCII is a subset of UTF-8 and most if not all programming languages are UTF-8 in source form now.

@osterman osterman added the bug label Apr 27, 2018
@osterman
Copy link
Collaborator

@colindean thanks for reporting the issue! I think your fix sounds reasonable. Our backlog has grown ever so large. We'll gladly accept any PRs, if you're willing to contribute.

@colindean
Copy link
Contributor Author

The problem isn't where I linked. That's where the license template is read. However, if the license template contains UTF-8 characters, it might still mess up.

I think it's here, where the source file itself appears to be read.

Problems could also occur when writing here.

I think the first step here is to write some tests around these areas…

@colindean
Copy link
Contributor Author

(yeah, I'm gonna work toward this at some point unless someone else gets to it first)

@colindean
Copy link
Contributor Author

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