zdavatz / oddb.org

Open Drug Database for Switzerland
https://ch.oddb.org
GNU General Public License v3.0
10 stars 8 forks source link

Fachinfo Diff incompatible character encoding #194

Closed zdavatz closed 1 year ago

zdavatz commented 1 year ago

https://ch.oddb.org/de/gcc/show/fachinfo/59322/diff/04.01.2023 https://ch.oddb.org/de/gcc/show/fachinfo/65512/diff/09.01.2023 https://ch.oddb.org/de/gcc/show/fachinfo/65770/diff/10.01.2023

ngiger commented 1 year ago

On oddb-ci2 I had no problems displaying the diffs. Used the following URLs:

http://192.168.0.75:8012/de/gcc/show/fachinfo/59322/diff/05.01.2023

http://192.168.0.75:8012/de/gcc/show/fachinfo/65512/diff/10.01.2023 http://192.168.0.75:8012/de/gcc/show/fachinfo/65512/diff/09.01.2023 http://192.168.0.75:8012/de/gcc/show/fachinfo/65512/diff/05.01.2023

http://192.168.0.75:8012/de/gcc/show/fachinfo/65770/diff/10.01.2023

zdavatz commented 1 year ago

What is your locale?

zdavatz@ch:~$ locale
LANG=de_CH.UTF-8
LANGUAGE=
LC_CTYPE="de_CH.UTF-8"
LC_NUMERIC="de_CH.UTF-8"
LC_TIME="de_CH.UTF-8"
LC_COLLATE=C
LC_MONETARY="de_CH.UTF-8"
LC_MESSAGES="de_CH.UTF-8"
LC_PAPER="de_CH.UTF-8"
LC_NAME="de_CH.UTF-8"
LC_ADDRESS="de_CH.UTF-8"
LC_TELEPHONE="de_CH.UTF-8"
LC_MEASUREMENT="de_CH.UTF-8"
LC_IDENTIFICATION="de_CH.UTF-8"
LC_ALL=
zdavatz commented 1 year ago

latest-screenshot

ngiger commented 1 year ago

Mine is

locale
LANG=de_CH.UTF-8
LC_CTYPE="de_CH.UTF-8"
LC_NUMERIC="de_CH.UTF-8"
LC_TIME="de_CH.UTF-8"
LC_COLLATE="de_CH.UTF-8"
LC_MONETARY="de_CH.UTF-8"
LC_MESSAGES="de_CH.UTF-8"
LC_PAPER="de_CH.UTF-8"
LC_NAME="de_CH.UTF-8"
LC_ADDRESS="de_CH.UTF-8"
LC_TELEPHONE="de_CH.UTF-8"
LC_MEASUREMENT="de_CH.UTF-8"
LC_IDENTIFICATION="de_CH.UTF-8"
LC_ALL=de_CH.UTF-8

And posgres is

ostgres=# \l
                                    List of databases
      Name      |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
----------------+----------+----------+-------------+-------------+-----------------------
 ch_oddb        | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 migel          | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 sandoz_xmlconv | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
                |          |          |             |             | postgres=CTc/postgres
 template1      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | postgres=CT/postgres +
                |          |          |             |             | =c/postgres
 test           | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 ydim           | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 yus            | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(9 rows)
ngiger commented 1 year ago

I think the following commit (which is present on oddb-ci2) fixed the problem: https://github.com/zdavatz/oddb.org/commit/99b993f62510e5627969c0446275c30605531532

zdavatz commented 1 year ago

Ok, lets check back on Ruby 3.2.0

zdavatz commented 1 year ago

https://github.com/zdavatz/ydiffy/blob/master/lib/diffy/html_formatter.rb

zdavatz commented 1 year ago

zdavatz@ch:~$ locale LANG=de_CH.UTF-8 LANGUAGE=de_CH.UTF-8 LC_CTYPE="de_CH.UTF-8" LC_NUMERIC="de_CH.UTF-8" LC_TIME="de_CH.UTF-8" LC_COLLATE="de_CH.UTF-8" LC_MONETARY="de_CH.UTF-8" LC_MESSAGES="de_CH.UTF-8" LC_PAPER="de_CH.UTF-8" LC_NAME="de_CH.UTF-8" LC_ADDRESS="de_CH.UTF-8" LC_TELEPHONE="de_CH.UTF-8" LC_MEASUREMENT="de_CH.UTF-8" LC_IDENTIFICATION="de_CH.UTF-8" LC_ALL=de_CH.UTF-8

ngiger commented 1 year ago

Added a testcase as per (#194) Added a testcase for 59322

But it does not throw an error. Unsure whether this might be a problem with the apache setup and its handling of UTF-8.

zdavatz commented 1 year ago

ydiffy-0.0.5 fixes this.