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

Error executing the repo_include macro (incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)) #1

Open
lxbzmy opened this issue Jul 30, 2013 · 5 comments
Assignees

Comments

@lxbzmy
Copy link

lxbzmy commented Jul 30, 2013

problem at this line. I 'm not familiar ruby. how can I fix it.

text = repo.cat(file_path);
@ghost ghost assigned gpr Jul 30, 2013
@gpr
Copy link
Owner

gpr commented Jul 30, 2013

Generally UTF-8 ruby error can be solved by adding "# encoding: utf-8" to the first line of the file. Not sure that it is relevant in this case but you can try.

@lxbzmy
Copy link
Author

lxbzmy commented Jul 30, 2013

Hi. I found the problem, redmine report encoding erro because of the file
which I include from scm .
so I add

text.force_encoding("UTF-8");

2013/7/30 Gregory Romé [email protected]

Generally UTF-8 ruby error can be solved by adding "# encoding: utf-8" to
the first line of the file. Not sure that it is relevant in this case but
you can try.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-21773063
.

@ghost
Copy link

ghost commented Dec 17, 2014

I had similar issue with repo_includewiki macro. In repo_include there is UTF8 conversion:

      text = repo.cat(file_path, rev)
      text = Redmine::CodesetUtil.to_utf8_by_setting(text)

Adding the second line to repo_includewiki solved the issue.

@gpr
Copy link
Owner

gpr commented Dec 18, 2014

Thanks! Could you create a pull request?

@ghost
Copy link

ghost commented Dec 18, 2014

Done! And thanks for the plugin (created a new ticket for that issue, not directly related to this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants