-
Notifications
You must be signed in to change notification settings - Fork 45
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 (invalid byte sequence in UTF-8) in system_info #150
Comments
BuildNumber=19044 |
Hi @yxiaoa thanks for reporting this! Can you post the error message in your log? This would help to find a solution for it. Which ruby version do you use? |
Ruby version:
I set win_info = '' instead of the returned value from wmic and it's ok. It seems that the Chinese characters in the Caption string caused this error. |
Hi @yxiaoa, Thanks for providing the additional info. With my last commit (main branch) I tried to fix the problem. Could you try it, if it works? I do not have the required testing operating system for it. It would be nice - if it works - if you can provide the displayed windows system information (which you can find on /admin/info). I want to check, if the relevant information are displayed, which I would expect. |
I do not have redmine 5.x, but I picked the changes based on 3.0.5.2. Information Default administrator account changed Environment: |
And yeah thanks for your work. Maybe this can become low priority as the page can be displayed. The Chinese words are not so important. |
Hi @yxiaoa, thanks for your feedback! Can you change this line: win_info = Redmine::CodesetUtil.replace_invalid_utf8 win_info to win_info = win_info.force_encoding('UTF-16LE').encode('UTF-8') If you fix the problem in your installation with the change, I would update it in additionals plugin. |
System info: Windows System info becomes just "Windows" |
Hi @yxiaoa, ahh, this is not the result, which I excepted. Is it possible, if you do another try with the following change: Change win_info = Redmine::CodesetUtil.replace_invalid_utf8 win_info to win_info.encode! 'UTF-8' The result should with your environment "Microsoft Windows 10 企业版 build 19044". If this is the case, we found the right solution ;) Thanks in advance for your help! |
Still "Windows". Maybe Chinese edition Windows' language is weired😂 I think it's ok to just display "Windows" as functions are not affected. However, I'm glad to test it if any changes made. |
I'm not sure whether you can add some logs to check the raw hex values that wmic outputs |
additionals/app/models/additionals_info.rb:33:in `system_info'
if Redmine::Platform.mswin?
win_info =
wmic os get Caption,CSDVersion,BuildNumber /value
return 'unknown' if win_info.blank?
Reported error if Windows is Chinese edition
The text was updated successfully, but these errors were encountered: