TracksApp / tracks

Tracks is a GTD™ web application, built with Ruby on Rails
https://www.getontracks.org/
GNU General Public License v2.0
1.18k stars 537 forks source link

Umlaut in Project Description #1771

Closed stderr-enst closed 9 years ago

stderr-enst commented 9 years ago

Tracks v 2.3rc1 I have noticed that umlaut-letters (like ä,ö,ü) in a Project description causes a faulty text for the description on the specific project page.

Here is a (bureaucratic) example: tracks_1

if I replace the umlaut-letters with something nicer the result is fine: tracks_2

C-Otto commented 9 years ago

I can't reproduce this (Apache, Linux, somewhat recent HEAD, PostgreSQL).

dnrce commented 9 years ago

@C-Otto, the bug report is against 2.3.rc1, not master. Can you reproduce there?

C-Otto commented 9 years ago

Tested on v2.3rc1, can't reproduce (Apache, Linux, SQLite).

stderr-enst commented 9 years ago

Okay, further information on my setup: Debian Wheezy (ARM) RVM for a ruby 2.2 environment SQLite3 WEBrick

C-Otto commented 9 years ago

Tested with WEBrick, can't reproduce.

C-Otto commented 9 years ago

What does the logfile say? Mine:

I, [2015-02-25T22:18:42.109766 #31758] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"SECRET", "_source_view"=>"project", "project"=>{"name"=>"Steuererklärung 2015", "description"=>"Steuererklärung 2015 machen", "state"=>"active", "default_context_name"=>"", "default_tags"=>""}, "wants_render"=>"true", "_group_view_by"=>"project", "_tag_name"=>"", "id"=>"1"}

C-Otto commented 9 years ago
$ sqlite3 tracks-20-blank.sqlite3.db 'select * from projects'
1|Steuererklärung 2015|0|1|Steuererklärung 2015 machen|active|2015-02-25 20:14:31.305970|2015-02-25 21:18:42.133954||||

$ sqlite3 tracks-20-blank.sqlite3.db 'select * from projects' | hexdump -C
00000000  31 7c 53 74 65 75 65 72  65 72 6b 6c c3 a4 72 75  |1|Steuererkl..ru|
00000010  6e 67 20 32 30 31 35 7c  30 7c 31 7c 53 74 65 75  |ng 2015|0|1|Steu|
00000020  65 72 65 72 6b 6c c3 a4  72 75 6e 67 20 32 30 31  |ererkl..rung 201|
00000030  35 20 6d 61 63 68 65 6e  7c 61 63 74 69 76 65 7c  |5 machen|active||
00000040  32 30 31 35 2d 30 32 2d  32 35 20 32 30 3a 31 34  |2015-02-25 20:14|
00000050  3a 33 31 2e 33 30 35 39  37 30 7c 32 30 31 35 2d  |:31.305970|2015-|
00000060  30 32 2d 32 35 20 32 31  3a 31 38 3a 34 32 2e 31  |02-25 21:18:42.1|
00000070  33 33 39 35 34 7c 7c 7c  7c 0a                    |33954||||.|
0000007a
stderr-enst commented 9 years ago

In my log there is only something like: I, [2015-02-26T12:23:36.622043 #5391] INFO -- : Parameters: {"id"=>"7"} if I open the projectpage. Might be a dumb question: but should I run tracks in development mode (currently production) for a more detailed log like yours?

The database seems to be correct: $ sqlite3 tracks 'select * from projects' […] 7|Steuererklärung|9|1|24.02.2015 Steuererklärung für 2015|active|2015-02-24 18:19:33.815621|2015-02-26 1:11:56.281857|9||finanzen|2015-02-25 16:24:41.798155 […]

Which is reasonable, because the complete and correct text is changeable when I edit the project-description.

C-Otto commented 9 years ago

For the log file entry, you need to change the project description (causing a PUT request in the log file, with the payload of the change).

stderr-enst commented 9 years ago

Thanks. Here the output: I, [2015-02-26T13:49:44.944781 #5391] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"vOMUtAU5F5QoX1mQjq+8Z0/ECXDwQBQu61oOju4Mzus=", "_source_view"=>"project", "project"=>{"name"=>"Steuererklärung", "description"=>"24.02.2015\nSteuererklärung für 2015", "state"=>"active", "default_context_name"=>"Organisation", "default_tags"=>"finanzen"}, "wants_render"=>"true", "_group_view_by"=>"project", "_tag_name"=>"", "id"=>"7"}

The text is correct in the Project Settings Description-Box. Just the displayed text is wrong.

C-Otto commented 9 years ago

Hm, I must admit I have no real clue, but my gut feeling is that the frontend/browser is to blame. Could you try using another browser? Check the language and locale settings in the browser? Run the browser in safe mode without plugins?

PS: I also tried adding a line break in the description, I still can't reproduce the problem.

stderr-enst commented 9 years ago

I've already tried it with Chromium, Opera and Firefox. Everywhere the same.

dnrce commented 9 years ago

@the193rd, what is your system locale (output of the locale command)? Also, can you please share the contents of your database.yml (with passwords and hostnames sanitized, of course)?

stderr-enst commented 9 years ago
$ locale
LANG=de_DE.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES=POSIX
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
$ cat database.yml
development:
  adapter: sqlite3 
  #adapter: mysql2
  database: tracks
  # set this if you are storing utf8 in your mysql database to handle strings
  # like "Réné". Not needed for sqlite. For PostgreSQL use encoding: unicode
  # encoding: utf8
  #host: localhost

production:
  adapter: sqlite3 
  database: tracks
  # set this if you are storing utf8 in your mysql database to handle strings
  # like "Réné".Not needed for sqlite. For PostgreSQL use encoding: unicode
  # encoding: utf8
  #host: localhost

# The following is an example to configure Tracks to use sqlite

#production:
#  adapter: sqlite3
#  database: db/tracks-20-blank.sqlite3.db
#  pool: 5
#  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &TEST
  adapter: sqlite3 
  database: tracks_test
  encoding: utf8

cucumber:
  <<: *TEST

I removed the username/password parts

C-Otto commented 9 years ago

For comparison, this is what I use on my server (where everything works as expected):

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.utf8
LC_TIME=de_DE.utf8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.utf8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=de_DE.utf8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
dnrce commented 9 years ago

@the193rd, could you perhaps post a gist of the HTML source of the page that isn't displaying correctly? I'm not able to reproduce this, and while the screenshots are helpful to illustrate the problem, they don't provide much information to troubleshoot. Thanks!

stderr-enst commented 9 years ago

@dnrce of course! https://gist.github.com/the193rd/75d42102e4a61722354d (I deleted the parts about other projects, tags and context - do you think they might be important?) The missing Text appears in line 130. It should be ”Dies ist ein ästhetischer Test mit öffentlichem gist.“

Btw. I noticed, that the problem also occurs in the drop-down notebox for some action. Should be related. If I edit the note/Description the full text is still available.

C-Otto commented 9 years ago

<div class="project_description"><p>Dies ist ein</p></div>

So the space before the umlaut also is removed...

dnrce commented 9 years ago

@the193rd, could you possibly test with Tracks 2.2? I'd like to know whether what you're seeing is a regression.

lrbalt commented 9 years ago

Could you enable utf8 in your database.yml too? See the comment on the encoding attribute

stderr-enst commented 9 years ago

Sorry for the delay, I’ll try to find the time for further tests this weekend. :)

dnrce commented 9 years ago

I'm unable to reproduce this with 2.3_branch @556c68c2e61ca0e504a33213435fcb6fdbeece80 in a Ubuntu 14.04.1 VM using RVM Ruby 2.2.1 and with locale set to the following:

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

Here's my database.yml:

development:
  adapter: sqlite3
  database: db/development.sqlite3
matjack1 commented 9 years ago

I'm on a similar system, Ruby 2.2.0 on Ubuntu 14.04 and I cannot reproduce the bug. I've the same database.yml and everything works fine.

@lrbalt was suggesting to enable utf-8, but actually the comment says also that is not needed for sqlite, and I confirm that.

Btw, I use accents quite often in Tracks on my installation (with PostgreSQL) and everything works fine.

dnrce commented 9 years ago

Given our inability to reproduce this I'm willing to close it. Any objections?

dnrce commented 9 years ago

No objections voiced.