Project

General

Profile

Actions

Defect #4766

open

Bad PDF files and SQL queries generated under certain locales

Added by Josef Grahn about 14 years ago. Updated about 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
PDF export
Target version:
-
Start date:
2010-02-08
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When running the latest stable version (0.9.2 from branches/0.9-stable) of Redmine with a Swedish locale (and likely others), PDF export as well as some SQL queries appear to stop working after the system has been in use for a while (typically a few hours).

Immediately after the server has been restarted, everything works fine. However, after certain, yet to be determined functions have been used in the web interface (but seemingly at least after having added a "New issue"), exported PDF files and some SQL queries start to become corrupt. This appears to have to do with floating point numbers being encoded as "123,45" rather than "123.45".

My best guess is that some code path inadvertently changes the locale used by sprintf(), which results in comma being used as decimal separator character instead of point. Consequently, SQL statements containing floating point values, as well as PDF files generated by the system, suddenly get invalid syntax (or valid but with a different meaning).

Exact version of Redmine:

URL: svn://rubyforge.org/var/svn/redmine/branches/0.9-stable
Archive UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 3394

Output from script/about:

About your application's environment
Ruby version 1.8.6 (x86_64-linux)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Application root /opt/redmine/redmine-0.9
Environment production
Database adapter mysql
Database schema version 20091227112908

System locale:

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

Actions

Also available in: Atom PDF