Page 1 of 1

[Halffixed since 1.11.2] CMSMS 1.11, a strftime("%A") issue

Posted: Thu Aug 09, 2012 6:51 pm
by Albert
Function setlocale() works improperly since version 1.11 and strftime("%A") returns "�����������" instead of weekday (with 1.10.3 setlocale works well). $config['locale'] helps only get weekday in english. The issue is browser and browserlanguagesettings independent.

Tested environment:
1. Linux 2.6.26-2-686-bigmem #1 SMP Thu Nov 25 01:59:22 UTC 2010 i686; Apache/1.3.41 (Unix) PHP/5.2.17; MySQL 5.0.51a-24+lenny4 - (Debian), UTF-8 Unicode (utf8).
2. Windows NT 6.1 build 7601; Apache/2.2.4 (Win32) mod_ssl/2.2.4 OpenSSL/0.9.8d PHP/5.2.4 (apache2handler); MySQL 5.0.45-community-nt - MySQL Community Edition (GPL), UTF-8 Unicode (utf8).

Re: CMSMS 1.11, strftime("%A") issue

Posted: Thu Aug 09, 2012 6:56 pm
by calguy1000
Please provide:
a: The system information as available from the CMSMS admin panel.
b: The contents of your config.php (with private data removed)
c: The language you are trying to use
d: Complete steps to reproduce the problem.

Additionally:
setlocale will only set the locale IF that information is installed on the server. i.e: I cannot call setlocale('de_DE.UFT8'); from my CMSMS installs because the german locale information is not installed on my server.

Additionally, windoze uses different strings for locale information so therefore caution has to be used when setting the locale in the config.php.

Re: CMSMS 1.11, strftime("%A") issue

Posted: Thu Aug 09, 2012 10:11 pm
by Albert
Respectively:

a.1 (Unfortunately, the production site rolled back to 1.10.3)
----------------------------------------------
Cms Version: 1.10.3

Installed Modules:

News: 2.12.3
CMSMailer: 2.0.2
MenuManager: 1.7.7
ModuleManager: 1.5.3
ThemeManager: 1.1.4
FormBuilder: 0.7.3
CGExtensions: 1.30
dboptimizer: 1.11
SiteMapMadeSimple: 1.2.6
Search: 1.7
FileManager: 1.2.0
Printing: 1.1.2
VisitorStats: 0.2.2
Captcha: 0.4.5
Gallery: 1.6
MicroTiny: 1.1.1

Config Information:

php_memory_limit:
process_whole_template: false
output_compression: false
max_upload_size: 10000000
default_upload_permission: 664
url_rewriting: mod_rewrite
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true

Php Information:

phpversion: 5.2.17
md5_function: On (True )
gd_version: 2
tempnam_function: On (True )
magic_quotes_runtime: Off (False )
E_STRICT: 0
memory_limit: 64M
max_execution_time: 60
output_buffering: 4096
safe_mode: Off (False )
file_uploads: On (True )
post_max_size: 10M
upload_max_filesize: 10M
session_save_path: /home/user/tmp (0700)
session_use_cookies: On (True )
xml_function: On (True )

Server Information:

Server Api: apache
Server Db Type: MySQL (mysql)
Server Db Version: 5.0.51a
----------------------------------------------

a.2
----------------------------------------------
Cms Version: 1.11

Installed Modules:

CGExtensions: 1.30
CMSMailer: 5.2.1
CMSPrinting: 1.0.2
Captcha: 0.4.5
FileManager: 1.4.0
Gallery: 1.6
MenuManager: 1.8.2
MicroTiny: 1.2.3
ModuleManager: 1.5.5
News: 2.12.7
Search: 1.7.6
SiteMapMadeSimple: 1.2.6
ThemeManager: 1.1.7
VisitorStats: 0.2.2
dboptimizer: 1.11
FormBuilder: 0.7.3

Config Information:

php_memory_limit:
process_whole_template:
output_compression:
max_upload_size: 12000000
url_rewriting: mod_rewrite
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true

Php Information:

phpversion: 5.2.4
md5_function: On (True )
gd_version: 2
tempnam_function: On (True )
magic_quotes_runtime: Off (False )
E_STRICT: 0
memory_limit: 128M
max_execution_time: 60
output_buffering: On
safe_mode: Off (False )
file_uploads: On (True )
post_max_size: 10M
upload_max_filesize: 12M
session_save_path: /tmp (0777)
session_use_cookies: On (True )
xml_function: On (True )
xmlreader_class: On (True )

Server Information:

Server Api: apache2handler
Server Db Type: MySQL (mysql)
Server Db Version: 5.0.45
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable
----------------------------------------------

b.1

Code: Select all

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['db_hostname'] = 'localhost:/home/user/run/mysql.sock';
$config['db_name'] = 'cms';
$config['db_password'] = '**************';
$config['db_port'] = 0;
$config['db_prefix'] = 'cms_';
$config['db_username'] = '*********';
$config['dbms'] = 'mysql';
$config['default_encoding'] = 'utf-8';
$config['page_extension'] = '';
$config['root_url'] = 'http://nevertell.you';
$config['ssl_url'] = 'https://nevertell.you';
$config['timezone'] = 'Europe/Moscow';
$config['url_rewriting'] = 'mod_rewrite';
?>
b.2

Code: Select all

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['db_hostname'] = 'localhost';
$config['db_name'] = 'cms';
$config['db_password'] = '***********';
$config['db_port'] = 0;
$config['db_prefix'] = 'cms_';
$config['db_username'] = '*********';
$config['dbms'] = 'mysql';
$config['default_encoding'] = 'utf-8';
$config['page_extension'] = '';
$config['root_url'] = 'http://cmsmsdflt.com';
$config['timezone'] = 'Europe/Moscow';
$config['url_rewriting'] = 'mod_rewrite';
?>
c.

el_GR, bg_BG, ru_RU
Results are the same - a number of "�", its quantity equals number of letters of weekday in native language.

d.

Create a UDT, something like:

Code: Select all

setlocale(LC_TIME, 'bg_BG.UTF-8');
echo strftime("%A")."\n".setlocale(LC_ALL, 0);
Insert it into a page template or play it with UDT editor. Have fun and do not get mad at me, please... I am afraid of you...

Re: CMSMS 1.11, strftime("%A") issue

Posted: Tue Sep 18, 2012 6:33 am
by Albert
Partially fixed for Linux by Isabela, 1.11.2. The problem still remains for News module month name. Exempli gratia, there are still "diamonds" on article edit page of admin panel instead of post date month. $config['locale'] has no effect in this case.
So, halffixed!