Version Gitlab 11.1.4
- Source file: encoding_helper.rb
- Path (on the file system): /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/encoding_helper.rb
- Fix: https://github.com/xRayDev/gitlab_windows1251/commit/1cdf4dd7db94e254c4487edeeea8675c8db7aa72#diff-c8cc55e6dc0de3038e6e5875cc74197c
- Link to a source file in the repository Gitlab: encoding_helper.rb
- Source file: grit_ext.rb
- Path (on the file system): /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/gitlab-grit-2.8.2/lib/grit_ext.rb
- Fix: https://github.com/xRayDev/gitlab_windows1251/commit/1cdf4dd7db94e254c4487edeeea8675c8db7aa72#diff-e55f3c175cd7224582f98cacd85da9ca
- Link to a source file in the repository Gitlab: grit_ext.rb
The paths to the files on the file system are specified for omnibus-gitlab.
In Gitlab Windows-1251 encoding is still broken in the file viewer and the commit viewer. In this repository i posted sample with there bug. And put fix for Gitlab.
This issue is subject to the projects in which the source code is not encoded in UTF-8.
The first mention of the problem https://github.com/gitlabhq/gitlabhq/issues/5493 This discussion of the problem was closed. Discussion moved here https://gitlab.com/gitlab-org/gitlab-ce/issues/14048
Ruby-gem charlock_holmes, responsible for the recognition of source coding and transferring them to UTF-8, can not understand what gives Windows-1251 to him.
Original source patch for old Gitlab version (from 31.10.2012) http://www.jackyfox.com/2012/10/31/gitlab-non-utf-8-russian-comments/
Π Gitlab ΠΊΠΎΠ΄ΠΈΡΠΎΠ²ΠΊΠ° Windows-1251 ΠΏΠΎ-ΠΏΡΠ΅ΠΆΠ½Π΅ΠΌΡ ΡΠ»ΠΎΠΌΠ°Π½Π° Π² ΠΏΡΠΎΡΠΌΠΎΡΡΡΠΈΠΊΠ΅ ΡΠ°ΠΉΠ»ΠΎΠ² ΠΈ ΠΏΡΠΎΡΠΌΠΎΡΡΡΠΈΠΊΠ΅ ΡΠΈΠΊΡΠ°ΡΠΈΠΉ. Π ΡΡΠΎΠΌ Ρ ΡΠ°Π½ΠΈΠ»ΠΈΡΠ΅ Ρ ΡΠ°Π·ΠΌΠ΅ΡΡΠΈΠ» ΠΎΠ±ΡΠ°Π·Π΅Ρ Ρ ΠΎΡΠΈΠ±ΠΊΠΎΠΉ. Π ΠΏΠΎΠ»ΠΎΠΆΠΈΠ» ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ Π΄Π»Ρ Gitlab.
ΠΡΠΎΠΉ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ΅ ΠΏΠΎΠ΄Π²Π΅ΡΠΆΠ΅Π½Ρ ΠΏΡΠΎΠ΅ΠΊΡΡ Π² ΠΊΠΎΡΠΎΡΡΡ ΠΈΡΡ ΠΎΠ΄Π½ΡΠΉ ΠΊΠΎΠ΄ Π½Π΅ Π² ΠΊΠΎΠ΄ΠΈΡΠΎΠ²ΠΊΠ΅ UTF-8.
ΠΠ΅ΡΠ²ΡΠ΅ ΡΠΏΠΎΠΌΠΈΠ½Π°Π½ΠΈΡ ΠΎ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ΅ https://github.com/gitlabhq/gitlabhq/issues/5493 ΠΡΠΎ ΠΎΠ±ΡΡΠΆΠ΄Π΅Π½ΠΈΠ΅ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ Π±ΡΠ»ΠΎ Π·Π°ΠΊΡΡΡΠΎ. ΠΠ±ΡΡΠΆΠ΄Π΅Π½ΠΈΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅ΡΡΠΈΠ»ΠΎΡΡ ΡΡΠ΄Π° https://gitlab.com/gitlab-org/gitlab-ce/issues/14048
Ruby-Π³Π΅ΠΌ charlock_holmes, ΠΎΡΠ²Π΅ΡΠ°ΡΡΠΈΠΉ Π·Π° ΡΠ°ΡΠΏΠΎΠ·Π½Π°Π²Π°Π½ΠΈΠ΅ ΠΊΠΎΠ΄ΠΈΡΠΎΠ²ΠΊΠΈ ΠΈΡΡ ΠΎΠ΄Π½ΠΈΠΊΠΎΠ² ΠΈ ΠΏΠ΅ΡΠ΅Π²ΠΎΠ΄Π° ΠΈΡ Π² UTF-8, Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ ΠΏΠΎΠ½ΡΡΡ, ΡΡΠΎ Π΄Π°ΡΡ Π΅ΠΌΡ Windows-1251.
ΠΠ΅ΡΠ²ΠΎΠ½Π°ΡΠ°Π»ΡΠ½ΡΠΉ ΠΈΡΡΠΎΡΠ½ΠΈΠΊ ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠΉ Π΄Π»Ρ ΡΡΠ°ΡΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ GitLab (ΠΎΡ 31.10.2012) http://www.jackyfox.com/2012/10/31/gitlab-non-utf-8-russian-comments/