Defect #22405

SQL server: non ASCII filter does not work

Added by Chi Nhan Nguyen over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues filter
Target version:3.3.0
Resolution:Fixed Affected version:3.1.3

Description

Filter not work with unicode.

feedback.png - feedback #22405 (17.5 KB) Chi Nhan Nguyen, 2016-04-06 10:50

Associated revisions

Revision 15350
Added by Jean-Philippe Lang over 1 year ago

SQL server: non ASCII filter on issue subject does not work (#22405).

Revision 15351
Added by Jean-Philippe Lang over 1 year ago

SQL server: non ASCII filter on issue subject does not work (#22405).

Revision 15352
Added by Jean-Philippe Lang over 1 year ago

Set source encoding (#22405).

Revision 15353
Added by Jean-Philippe Lang over 1 year ago

SQL server: non ASCII filter on text fields does not work (#22405).

History

#1 Updated by Toshi MARUYAMA over 1 year ago

  • Status changed from New to Needs feedback

#2 Updated by Chi Nhan Nguyen over 1 year ago

I have new Issues like image. when i filter with "Kiểm", it not show.
#22405" alt="feedback #22405" />

#3 Updated by Toshi MARUYAMA over 1 year ago

Submissions

Before submitting a bug report here, please make sure:
.
.
.

#4 Updated by Chi Nhan Nguyen over 1 year ago

Sory, i setup server on windows and SQL server 2012.

Environment:
Redmine version 3.2.0.stable
Ruby version 2.1.8-p440 (2015-12-16) [i386-mingw32]
Rails version 4.2.5
Environment production
Database adapter SQLServer
SCM:
Git 1.9.4
Filesystem
Redmine plugins:
redmine_ckeditor 1.1.3

#5 Updated by Toshi MARUYAMA over 1 year ago

I cannot reproduce.

Environment:
  Redmine version                3.2.1.stable
  Ruby version                   1.9.3-p551 (2014-11-13) [x86_64-linux]
  Rails version                  4.2.5.2
  Environment                    production
  Database adapter               SQLite
SCM:
  Subversion                     1.6.11
  Darcs                          2.2.0
  Mercurial                      2.8.2
  Cvs                            1.12.13
  Bazaar                         2.1.1
  Git                            1.7.1
  Filesystem
Redmine plugins:
  no plugin installed

You would better ask https://github.com/rails-sqlserver .

#6 Updated by Toshi MARUYAMA over 1 year ago

  • Subject changed from Filter with Unicode to SQL server: non ASCII filter does not work
  • Status changed from Needs feedback to New

#7 Updated by Chi Nhan Nguyen over 1 year ago

  • Status changed from New to Resolved

I solved by adding characters N on SQL LIKE statement.

  # Returns a SQL LIKE statement with wildcards
  def sql_contains(db_field, value, match=true)
    if ActiveRecord::Base.connection.adapter_name == "SQLServer" 
        value = "N'%#{self.class.connection.quote_string(value.to_s)}%'"    
    else
        value = "'%#{self.class.connection.quote_string(value.to_s)}%'" 
    end
    Redmine::Database.like(db_field, value, :match => match)
  end

thanks.

#8 Updated by Toshi MARUYAMA over 1 year ago

  • Status changed from Resolved to New
  • Target version set to 3.3.0

#9 Updated by Jean-Philippe Lang over 1 year ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Also available in: Atom PDF