Skip to content

Commit

Permalink
#150 try to fix invalid byte sequence bug for windows system info
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 27, 2022
1 parent f9199b7 commit b8b1628
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/models/additionals_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ def system_infos

def system_info
if Redmine::Platform.mswin?
win_info = `wmic os get Caption,CSDVersion,BuildNumber /value`
return 'unknown' if win_info.blank?
unkwown_windows = 'Windows'
begin
win_info = `wmic os get Caption,CSDVersion,BuildNumber /value`
win_info = Redmine::CodesetUtil.replace_invalid_utf8 win_info
return unkwown_windows if win_info.blank?
rescue StandardError
return unkwown_windows
end

windows_version = ''
windows_build = ''
Expand Down

0 comments on commit b8b1628

Please sign in to comment.