# HG changeset patch # User Chris Cannam # Date 1331656429 0 # Node ID ad295b270cd42713e0bdc68ae65a6962a4b953d5 # Parent 8623d131c9ad321b687c76278d99a8ef8a7f963d FIx #446: "non-utf8 paths in repositories blow up repo viewer and reposman" by ensuring the iconv conversion always happens even if source and dest are intended to be the same encoding diff -r 8623d131c9ad -r ad295b270cd4 lib/redmine/scm/adapters/abstract_adapter.rb --- a/lib/redmine/scm/adapters/abstract_adapter.rb Thu Feb 02 15:26:47 2012 +0000 +++ b/lib/redmine/scm/adapters/abstract_adapter.rb Tue Mar 13 16:33:49 2012 +0000 @@ -242,7 +242,12 @@ def scm_iconv(to, from, str) return nil if str.nil? - return str if to == from + # bug 446: non-utf8 paths in repositories blow up repo viewer and reposman + # -- Remove this short-circuit: we want the conversion to + # happen always, so we can trap the error here if the + # source text happens not to be in the advertised + # encoding (instead of having the database blow up later) +# return str if to == from begin Iconv.conv(to, from, str) rescue Iconv::Failure => err