Index: app/helpers/repositories_helper.rb
===================================================================
--- app/helpers/repositories_helper.rb	(revision 1794)
+++ app/helpers/repositories_helper.rb	(working copy)
@@ -78,31 +78,38 @@
       content_tag('p', form.password_field(:password, :size => 30, :name => 'ignore',
                                            :value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)),
                                            :onfocus => "this.value=''; this.name='repository[password]';",
-                                           :onchange => "this.name='repository[password]';"))
+                                           :onchange => "this.name='repository[password]';")) +
+      content_tag('p', form.text_field(:encoding, :size => 30, :disabled => (repository && !repository.root_url.blank?)))
   end
 
   def darcs_field_tags(form, repository)
-      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
+      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?))) +
+      content_tag('p', form.text_field(:encoding, :size => 30,  :disabled => ( repository && !repository.new_record?)))
   end
   
   def mercurial_field_tags(form, repository)
-      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
+      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?))) +
+      content_tag('p', form.text_field(:encoding, :size => 30,   :disabled => (repository && !repository.root_url.blank?)))
   end
 
   def git_field_tags(form, repository)
-      content_tag('p', form.text_field(:url, :label => 'Path to .git directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
+      content_tag('p', form.text_field(:url, :label => 'Path to .git directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?))) +
+      content_tag('p', form.text_field(:encoding, :size => 30,   :disabled => (repository && !repository.root_url.blank?)))
   end
 
   def cvs_field_tags(form, repository)
       content_tag('p', form.text_field(:root_url, :label => 'CVSROOT', :size => 60, :required => true, :disabled => !repository.new_record?)) +
-      content_tag('p', form.text_field(:url, :label => 'Module', :size => 30, :required => true, :disabled => !repository.new_record?))
+      content_tag('p', form.text_field(:url, :label => 'Module', :size => 30, :required => true, :disabled => !repository.new_record?)) +
+      content_tag('p', form.text_field(:encoding, :size => 30,   :disabled => (repository && !repository.new_record?)))
   end
 
   def bazaar_field_tags(form, repository)
-      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
+      content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?))) +
+      content_tag('p', form.text_field(:encoding, :size => 30,   :disabled => (repository && !repository.new_record?)))
   end
   
   def filesystem_field_tags(form, repository)
-    content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
+    content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?))) +
+    content_tag('p', form.text_field(:encoding, :size => 30,   :disabled => (repository && !repository.root_url.blank?)))
   end
 end
Index: app/models/repository/subversion.rb
===================================================================
--- app/models/repository/subversion.rb	(revision 1794)
+++ app/models/repository/subversion.rb	(working copy)
@@ -19,7 +19,7 @@
 
 class Repository::Subversion < Repository
   attr_protected :root_url
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
   validates_format_of :url, :with => /^(http|https|svn|svn\+ssh|file):\/\/.+/i
 
   def scm_adapter
Index: app/models/repository/bazaar.rb
===================================================================
--- app/models/repository/bazaar.rb	(revision 1794)
+++ app/models/repository/bazaar.rb	(working copy)
@@ -19,7 +19,7 @@
 
 class Repository::Bazaar < Repository
   attr_protected :root_url
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::BazaarAdapter
Index: app/models/repository/git.rb
===================================================================
--- app/models/repository/git.rb	(revision 1794)
+++ app/models/repository/git.rb	(working copy)
@@ -19,7 +19,7 @@
 
 class Repository::Git < Repository
   attr_protected :root_url
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::GitAdapter
Index: app/models/repository/mercurial.rb
===================================================================
--- app/models/repository/mercurial.rb	(revision 1794)
+++ app/models/repository/mercurial.rb	(working copy)
@@ -19,7 +19,7 @@
 
 class Repository::Mercurial < Repository
   attr_protected :root_url
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::MercurialAdapter
Index: app/models/repository/filesystem.rb
===================================================================
--- app/models/repository/filesystem.rb	(revision 1794)
+++ app/models/repository/filesystem.rb	(working copy)
@@ -22,7 +22,7 @@
 
 class Repository::Filesystem < Repository
   attr_protected :root_url
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::FilesystemAdapter
Index: app/models/repository/cvs.rb
===================================================================
--- app/models/repository/cvs.rb	(revision 1794)
+++ app/models/repository/cvs.rb	(working copy)
@@ -19,7 +19,7 @@
 require 'digest/sha1'
 
 class Repository::Cvs < Repository
-  validates_presence_of :url, :root_url
+  validates_presence_of :url, :root_url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::CvsAdapter
Index: app/models/repository/darcs.rb
===================================================================
--- app/models/repository/darcs.rb	(revision 1794)
+++ app/models/repository/darcs.rb	(working copy)
@@ -18,7 +18,7 @@
 require 'redmine/scm/adapters/darcs_adapter'
 
 class Repository::Darcs < Repository
-  validates_presence_of :url
+  validates_presence_of :url, :encoding
 
   def scm_adapter
     Redmine::Scm::Adapters::DarcsAdapter
Index: app/models/repository.rb
===================================================================
--- app/models/repository.rb	(revision 1794)
+++ app/models/repository.rb	(working copy)
@@ -31,14 +31,19 @@
   def url=(arg)
     write_attribute(:url, arg ? arg.to_s.strip : nil)
   end
-  
+
+	def encoding=(arg)
+    write_attribute(:encoding, arg ? arg.to_s.strip : nil)
+  end
+
+
   # Removes leading and trailing whitespace
   def root_url=(arg)
     write_attribute(:root_url, arg ? arg.to_s.strip : nil)
   end
 
   def scm
-    @scm ||= self.scm_adapter.new url, root_url, login, password
+    @scm ||= self.scm_adapter.new url, root_url, login, password, encoding
     update_attribute(:root_url, @scm.root_url) if root_url.blank?
     @scm
   end
@@ -129,6 +134,7 @@
     # Strips url and root_url
     url.strip!
     root_url.strip!
+    encoding.strip!
     true
   end
   
Index: app/controllers/application.rb
===================================================================
--- app/controllers/application.rb	(revision 1794)
+++ app/controllers/application.rb	(working copy)
@@ -33,7 +33,8 @@
   def current_role
     @current_role ||= User.current.role_for_project(@project)
   end
-  
+ 
+
   def user_setup
     # Check the settings cache for each request
     Setting.check_cache
Index: lib/redmine/scm/adapters/abstract_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/abstract_adapter.rb	(revision 1794)
+++ lib/redmine/scm/adapters/abstract_adapter.rb	(working copy)
@@ -15,6 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+require 'iconv'
 require 'cgi'
 
 module Redmine
@@ -47,13 +48,24 @@
           end
         end
                 
-        def initialize(url, root_url=nil, login=nil, password=nil)
+        def initialize(url, root_url=nil, login=nil, password=nil, encoding=nil)
           @url = url
           @login = login if login && !login.empty?
           @password = (password || "") if @login
           @root_url = root_url.blank? ? retrieve_root_url : root_url
+          @encoding = encoding.blank? ? "UTF-8" : encoding 
         end
-        
+       
+				def to_utf(str)
+					if encoding != nil and str != nil and encoding != "UTF-8" 
+							logger.debug "Encoding, from: #{encoding}"
+							return Iconv.conv("UTF-8", encoding, str)
+				  end
+					logger.debug "Don't encoding, enc: #{encoding}"
+					return str
+
+				end
+
         def adapter_name
           'Abstract'
         end
@@ -69,7 +81,11 @@
         def root_url
           @root_url
         end
-      
+     
+  			def encoding
+					@encoding
+				end
+
         def url
           @url
         end
Index: lib/redmine/scm/adapters/cvs_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/cvs_adapter.rb	(revision 1794)
+++ lib/redmine/scm/adapters/cvs_adapter.rb	(working copy)
@@ -30,10 +30,12 @@
         #  root_url -> the good old, sometimes damned, CVSROOT
         #  login -> unnecessary
         #  password -> unnecessary too
-        def initialize(url, root_url=nil, login=nil, password=nil)
+        #  encoding -> unnecessary too
+        def initialize(url, root_url=nil, login=nil, password=nil, encoding="UTF-8")
           @url = url
           @login = login if login && !login.empty?
           @password = (password || "") if @login
+					@encoding = encoding
           #TODO: better Exception here (IllegalArgumentException)
           raise CommandFailed if root_url.blank?
           @root_url = root_url
@@ -220,7 +222,7 @@
                   #                  version.line_minus = 0     
                   #                end              
                 else            
-                  commit_log << line unless line =~ /^\*\*\* empty log message \*\*\*/
+                  commit_log << to_utf( (line unless line =~ /^\*\*\* empty log message \*\*\*/) )
                 end 
               end 
             end
