Open andzs opened 9 years ago
This doesn't happen on my test set-up or any of the installed sites I know about. Can you please provide a few more details:
1) What version of PHP are you using?
2) Is this a new RG2 installation or is it using an old RG1 database?
3) What are RG_INPUT_ENCODING and RG_OUTPUT_ENCODING set to in your rg2-config.php file?
3) Can you give me a link so that I can see the problem?
Hello,
phpinfo() data available here http://mezu.lv/info.php
Config
bash-4.1$ cat rg2-config.php | grep -E "^\s+define"
define('RG_BASE_DIRECTORY', 'http://izskreju.mezu.lv/gadget');
define('SPLITSBROWSER_DIRECTORY', 'http://izskreju.mezu.lv/splitsbrowser' );
define('RG_FILE_ENCODING', 'UTF-8');
define('UI_THEME', 'smoothness');
define('HEADER_COLOUR', '#002bd9');
define('HEADER_TEXT_COLOUR', '#ffffff');
define('ADDITIONAL_INFO_TEXT', ''); 4.
OK setup with setlocale (and define('RG_BASE_DIRECTORY', ' http://izskreju.mezu.lv');) http://izskreju.mezu.lv/rg2/#125 http://izskreju.mezu.lv/rg2/#125 Problematic setup without setlocale http://izskreju.mezu.lv/gadget/rg2/#125 http://izskreju.mezu.lv/gadget/rg2/#125
Take a look, please, at course M21S
In results sixth position correct name is "Ēriks Lebedoks" but problematic version returns "riks Lebedoks". On 15th position "Ģirts Pakalns" turns into "irts Pakalns" and his submitted GPS entry got corrupted name permanently (the same in both setups). Just look for names starting with non capital letters to find other examples.
Splitbrowser in problematic setup http://izskreju.mezu.lv/gadget/rg2/rg2api.php?type=splitsbrowser&id=125 for the same course will show that names are OK. In this case rg2api is not using fgetcsv to get results, names and everything looks fine.
--Andris
On Mon, Jul 13, 2015 at 10:29 PM, Simon Errington notifications@github.com wrote:
This doesn't happen on my test set-up or any of the installed sites I know about. Can you please provide a few more details:
1) What version of PHP are you using?
2) Is this a new RG2 installation or is it using an old RG1 database?
3) What are RG_INPUT_ENCODING and RG_OUTPUT_ENCODING set to in your rg2-config.php file?
3) Can you give me a link so that I can see the problem?
— Reply to this email directly or view it on GitHub https://github.com/Maprunner/rg2/issues/287#issuecomment-121031394.
Andris Strazdiņš tel. 29248436
Hi,
I expanded possible solutions for my problem and I think that problem goes away if Apache has
SetEnv LC_ALL en_US.UTF-8
directive in .htaccess file (I am unable to modify httpd.conf file in hosted environment). Locale setting is set to UTF-8 in apache and derived environment and there is no need to use setlocale in php code anymore.
--Andris
On Tue, Jul 14, 2015 at 2:41 AM, Andris Strazdiņš andzss@gmail.com wrote:
Hello,
- I have hosted environment
phpinfo() data available here http://mezu.lv/info.php
- I have old RG1 database which was converted to UTF-8 and worked for a while with RG1 Javascript version
Config
bash-4.1$ cat rg2-config.php | grep -E "^\s+define"
define('RG_BASE_DIRECTORY', 'http://izskreju.mezu.lv/gadget');
define('SPLITSBROWSER_DIRECTORY', ' http://izskreju.mezu.lv/splitsbrowser');
define('RG_FILE_ENCODING', 'UTF-8');
define('UI_THEME', 'smoothness');
define('HEADER_COLOUR', '#002bd9');
define('HEADER_TEXT_COLOUR', '#ffffff');
define('ADDITIONAL_INFO_TEXT', ''); 4.
OK setup with setlocale (and define('RG_BASE_DIRECTORY', ' http://izskreju.mezu.lv');) http://izskreju.mezu.lv/rg2/#125 http://izskreju.mezu.lv/rg2/#125 Problematic setup without setlocale http://izskreju.mezu.lv/gadget/rg2/#125 http://izskreju.mezu.lv/gadget/rg2/#125
Take a look, please, at course M21S
In results sixth position correct name is "Ēriks Lebedoks" but problematic version returns "riks Lebedoks". On 15th position "Ģirts Pakalns" turns into "irts Pakalns" and his submitted GPS entry got corrupted name permanently (the same in both setups). Just look for names starting with non capital letters to find other examples.
Splitbrowser in problematic setup http://izskreju.mezu.lv/gadget/rg2/rg2api.php?type=splitsbrowser&id=125 for the same course will show that names are OK. In this case rg2api is not using fgetcsv to get results, names and everything looks fine.
--Andris
On Mon, Jul 13, 2015 at 10:29 PM, Simon Errington < notifications@github.com> wrote:
This doesn't happen on my test set-up or any of the installed sites I know about. Can you please provide a few more details:
1) What version of PHP are you using?
2) Is this a new RG2 installation or is it using an old RG1 database?
3) What are RG_INPUT_ENCODING and RG_OUTPUT_ENCODING set to in your rg2-config.php file?
3) Can you give me a link so that I can see the problem?
— Reply to this email directly or view it on GitHub https://github.com/Maprunner/rg2/issues/287#issuecomment-121031394.
Andris Strazdiņš tel. 29248436
Andris Strazdiņš tel. 29248436
Checking out RG2 I run in following issue - RG2 is missing first character of competitor name if it starts with foreign character. Integrated Splitsbrowser displays names correctly without any problems. All the data files are in UTF8 encoding. The problems with UTF8 and fgetcsv are described also here http://stackoverflow.com/questions/5756373/missing-first-character-of-fields-in-csv https://bugs.php.net/bug.php?id=48507#1274173422
Quick and dirty fix for me was using setlocale(LC_ALL, 'en_US.UTF-8'); at begginning of rg2api.php but that should be used only in case of UTF-8 for data and RG2 encoding.