プロジェクト

全般

プロフィール

Vote #64772

未完了

Make user sorting by his localized encoding name instead of utf-8 encoding name

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
-
開始日:
2009/02/28
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
0
issue_org_id:
2862
author_id:
460
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

For those using non-ASCII systems, sorting user by name using a utf-8 encoding name and sorting user by name using their localized encoding name have different results.

For example: there are three users: user1, user2, user3.
If we sort them by name using the original utf-8 strings, the order may be: user1, user2, user3.
But when we convert the name string to another encoding(like gb2312) first, and then sort them by name, the result's order may be: user2, user1, user3.
And the second result is more acceptable than the first one.

So I thought that it would be great to convert the name string from utf-8 to the localized encoding before sorting user by name.

Since there is just one line bo be add to the user's model class, I didn't attach a diff file.
About line 217:


  def <=>(user)
    ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
    ic.iconv(self.to_s.downcase) <=> ic.iconv(user.to_s.downcase)
  end


journals

--------------------------------------------------------------------------------

Admin Redmine さんがほぼ4年前に更新

  • カテゴリI18n_37 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0