Back to the index page  
LiveChat! (0 online)   FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 
Web2project and utf8 ?

 
Post new topic   Reply to topic    web2Project Forum Index » web2Project BETA Testing View previous topic :: View next topic  
Web2project and utf8 ?
 PostPosted: Wed Mar 12, 2008 2:05 pm Reply with quote  
Message
  king76
I want to know more...

Joined: 12 Mar 2008
Posts: 2
Hi,

I'm new user of Web2project. I like this new project !! It's more dynamic that dotprojec, yeah !

So.. I'm testing SVN version and i have problem with utf8 and character.
My language is FRENCH, so i have some character as é, à è, etc ..

Database use utf8.. so it's possible to change encoding for web2project ? Because firefox generated page in utf-8 format.. (charset source page also.)

Idea ?

Thank You
View user's profile Send private message
 PostPosted: Wed Mar 12, 2008 2:51 pm Reply with quote  
Message
  pedroa
Site Admin

Joined: 27 Oct 2007
Posts: 725
Location: Portugal
Hi king76,

You may not know but I am Portuguese and so I also suffer from this accents problems and such, so I understand your point.
To solve the most of my problems I tried to stick with the ISO standard instead of UTF. So I have my database, my locale and my inc files synched to the iso-8859-1 charset which supports the accents I need.
The reason I am not dedicating more effort to solve UTF issues with w2P is due to most of my sponsors being from the USA which kinda closes the problem at birth.

A worse problem is with Chinese and Japanese that do require UTF.
Since I am not from one of those countries that require UTF I have some difficulty to understand the problem because you could show me some Chinese and I wouldn't understand a thing.
So if you want to help on such issues you could provide feedback with what is w2P doing wrong on our Bugs site so that I can provide a solution that could work with both ISO and UTF standards.

Thanks for the feedback,

Pedro A.

_________________
Peace!
View user's profile Send private message Visit poster's website
 PostPosted: Wed Mar 12, 2008 4:03 pm Reply with quote  
Message
  king76
I want to know more...

Joined: 12 Mar 2008
Posts: 2
Hi Pedro,

First.. let me say THANK YOU FOR YOUR JOB ! Wink You are behind a good project and dynamic.

So.. I have find problem with my bad character.. it's not on all module, example :

- In project :
-- Company (view) : problem with entities
-- Company (edit) : it's correct
-- Project Name (edit) : character * Wink
-- Project location (edit) : character *..

etc.. so it's easy to correct problem with entities.. and it's correct in view, it's also easy to change in edit mode ?

sorry for my bad english Wink I prefer speak french lol

Do you want that add new ticket in your bug tracker ?

Bye
View user's profile Send private message
 PostPosted: Wed Mar 12, 2008 6:04 pm Reply with quote  
Message
  pedroa
Site Admin

Joined: 27 Oct 2007
Posts: 725
Location: Portugal
king76 wrote:
Hi Pedro,

First.. let me say THANK YOU FOR YOUR JOB ! Wink You are behind a good project and dynamic.


Thanks king76 for your kind words, since I do this for a living you can be sure the project will be dynamic, as to being good I'll leave that judgment to the community.

king76 wrote:
So.. I have find problem with my bad character.. it's not on all module, example :

- In project :
-- Company (view) : problem with entities
-- Company (edit) : it's correct
-- Project Name (edit) : character * Wink
-- Project location (edit) : character *..

etc.. so it's easy to correct problem with entities.. and it's correct in view, it's also easy to change in edit mode ?

sorry for my bad english Wink I prefer speak french lol

Do you want that add new ticket in your bug tracker ?

Bye


This problem will be resolved once we have on the code only one way of retrieving the data from the database, and that's is something we plan to do on (or in the path of) a 1.5 version.
I already have one ticket regarding entities showing on the Gantt charts which it is assigned to me for fixing.
If you can identify each problematic interface (its URL) and an image and attach it to the ticket on the Bugs site that would help a lot.

Don't worry about your English because I probably understand you better than with French.

Thanks for the support,

Pedro A.

_________________
Peace!
View user's profile Send private message Visit poster's website
 PostPosted: Sun Mar 15, 2009 6:40 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
Hello,

To add utf-8 support, do the following :

1) in index.php, find the line :
Code:
header('Pragma: no-cache'); // HTTP/1.0
add these lines after it:
Code:
header("Content-type: text/html; charset=UTF-8");
// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
setlocale(LC_CTYPE, 'C');


2) in install/sql/001_base_install.mysql.sql, replace all :
Code:
DEFAULT CHARSET=latin1

by :
Code:
DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci


3) at the end of install/sql/dp_to_w2p2.sql add these lines :
Code:
ALTER TABLE `billingcode` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `companies` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `config` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `config_list` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `contacts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `custom_fields_lists` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `custom_fields_struct` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `custom_fields_values` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `departments` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `event_contacts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `event_queue` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `events` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `file_folders` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `files` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `files_index` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `forum_messages` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `forum_visits` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `forum_watch` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `forums` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_acl` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_acl_sections` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_acl_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aco` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aco_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aco_sections` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aco_sections_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aco_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_groups` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_groups_id_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_groups_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_sections` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_sections_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_aro_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_groups` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_groups_id_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_groups_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_sections` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_sections_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_axo_seq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_groups_aro_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_groups_axo_map` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_permissions` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `gacl_phpgacl` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `history` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `links` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `modules` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `project_contacts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `project_departments` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `project_designer_options` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `projects` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `resource_tasks` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `resource_types` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `resources` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `sessions` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `syskeys` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `sysvals` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `task_contacts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `task_departments` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `task_dependencies` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `task_log` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_critical` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_problems` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_sum` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_summy` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_total` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `tasks_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_access_log` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_events` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_preferences` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_task_pin` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_tasks` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `w2pversion` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

NB: if your database is already installed, run these requests with phpmyadmin

4) Add attribute 'charset="utf-8"' to all html <link> element in all files
<link rel="stylesheet" type="text/css" charset="utf-8" href="...">

5) Add attribute 'accept-charset="utf-8"' to all html <form> element in all files
<form method="..." accept-charset="utf-8" action=".......">

6) in includes/main_functions, delete function : w2Phtml_entity_decode

7) remove call of the w2Phtmlspecialchars function in :
- classes/query.class.php,
- modules/calendar/links_tasks.php,
- modules/system/contacts_ldap.php,
- modules/system/systemconfig.php

8) in includes/main_functions, delete function : w2Phtmlspecialchars

9) replace htmlentities by htmlspecialchars in files :
- classes/ui.class.php
- modules/calendar/day_view.php
- modules/calendar/week_view.php
- modules/calendar/week_view.php
- modules/calendar/year_view.php
- modules/tasks/ae_dates.php:

10) convert all files (except .inc) from ansi to utf-8
- linux : find . -name "*.(php|js|css|htm|html)" -exec iconv -f ISO-8859-1 -t UTF-8 {} -o ../web2project_utf8/{}
- windows : use UTF_Tool.exe
View user's profile Send private message
 PostPosted: Mon Mar 16, 2009 7:46 pm Reply with quote  
Message
  corianton
Faithfull Member

Joined: 08 May 2008
Posts: 88
I'll have to try this, thanks Eureka. Question though, do you think that this will fix the Gantt chart display problems, or just the ones in like the Companies module? I have been playing around with different versions of the Gantt chart generating software and I think the problem is it only has one font or something I don't know, just wondering if this fixed it or not. My company has Japanese clients, and so the names don't show up right.
View user's profile Send private message
 PostPosted: Mon Mar 16, 2009 8:37 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
corianton wrote:
do you think that this will fix the Gantt chart display problems?

Yes !

First, backup the database and your web2project directory.

If some columns contain entities (&...;)in the database (such as company name or company description), edit them with web2project after conversion.

I also added this function :
Code:
//
// An UTF-8 aware version of strlen()
//
function w2PUTF8strlen($str)
{
  return strlen(utf8_decode($str));
}

into includes/main_functions.php.
I am currently checking all calls to the strlen function and sometimes I replace it with w2PUTF8strlen when necessary.
View user's profile Send private message
 PostPosted: Wed Mar 18, 2009 3:59 am Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
Eureka, thanks for all the feedback and suggestions.

Quick question... do any of those changes change/damage support for a basic English character set?

Thanks for the great work by the way.

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Wed Mar 18, 2009 6:57 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
caseydk wrote:
Quick question... do any of those changes change/damage support for a basic English character set?

No, because UTF-8 is a superset of ASCII. All characters of an English string are one-byte long. UTf8, ISO-8859-1, US-ASCII are equivalent for English strings.
View user's profile Send private message
 PostPosted: Sun Mar 22, 2009 2:47 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
Alright, sounds good... I'll see what I can do to get this merged in the next week or so.
_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Mon Mar 23, 2009 9:00 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
oh yes, this would be really nice!

I checked all the string functions that contain constant arguments (except 0) so:

in modules/projectdesigner/projectdesigner.class.php:
line 375, replace :
Code:
    $alt = strlen($a['task_description']) > 80 ? substr($a['task_description'], 0, 80) . '...' : $a['task_description'];

by :
Code:
    $alt = w2PUTF8strlen($a['task_description']) > 80 ? w2PUTF8substr($a['task_description'], 0, 80) . '...' : $a['task_description'];

in modules/projectdesigner/vw_actions.php:
line 216, replace :
Code:
      $task_data['task_name'] = strlen($task_data[1]) > 45 ? substr($task_data['task_name'], 0, 45) . "..." : $task_data['task_name'];

by :
Code:
       $task_data['task_name'] = w2PUTF8strlen($task_data[1]) > 45 ? w2PUTF8substr($task_data['task_name'], 0, 45) . "..." : $task_data['task_name'];

in modules/projectimporter/imports/msproject.php:
line 306, replace :
Code:
                               if (strlen($r['NAME']) < w2PgetConfig('username_min_len')) {

by :
Code:
                               if (w2PUTF8strlen($r['name']) < w2PgetConfig('username_min_len')) {

modules/projectimporter/imports/wbs.php:
line 268, replace :
Code:
                                       if (strlen($r['name']) < w2PgetConfig('username_min_len')) {

by :
Code:
                                       if (w2PUTF8strlen($r['name']) <w2PgetConfig>project_short_name) > 10) {
                  $this->project_short_name = substr($this->project_short_name, 0, 10);

by :
Code:
   if (w2PUTF8strlen($this->project_short_name) > 10) {
                  $this->project_short_name = w2PUTF8substr($this->project_short_name, 0, 10);

in modules/projects/vw_sub_projects_gantt.php:
line 405, replace :
Code:
                                   $bar2 = new GanttBar($row++, array((strlen($advance . $t['task_name']) > 35 ? substr($advance . $t['task_name'], 0, 33) . '...' : $advance . $t['task_name']), $tStartObj->format($df), $tEndObj->format($df), ' '), $tStart, $tEnd, ' ', $t['task_dynamic'] == 1 ? 0.1 : 0.6);

by :
Code:
                                   $bar2 = new GanttBar($row++, array((w2PUTF8strlen($advance . $t['task_name']) > 35 ? w2PUTF8substr($advance . $t['task_name'], 0, 33) . '...' : $advance . $t['task_name']), $tStartObj->format($df), $tEndObj->format($df), ' '), $tStart, $tEnd, ' ', $t['task_dynamic'] == 1 ? 0.1 : 0.6);


in modules/system/translate.php:
line 112, replace :
Code:
         if (strlen($langs['english']) < 40) {

by :
Code:
         if (w2PUTF8strlen($langs['english']) < 40) {


line 115, replace :
Code:
                 $rows = round(strlen($langs['english'] / 35)) + 1;

by :
Code:
                 $rows = round(w2PUTF8strlen($langs['english'] / 35)) + 1;


line 125, replace :
Code:
         if (strlen($langs['lang']) < 40) {

by :
Code:
         if (w2PUTF8strlen($langs['lang']) <40> 30) {
                    $dept_info['dept_name'] = substr($dept_info['dept_name'], 0, 28) . '...';

by :
Code:
            if (w2PUTF8strlen($dept_info['dept_name']) > 30) {
                    $dept_info['dept_name'] = w2PUTF8substr($dept_info['dept_name'], 0, 28) . '...';


where w2PUTF8strlen and w2PUTF8substr are :

Code:
function w2PUTF8strlen($str) {
   global $locale_char_set;

   if (!$locale_char_set) {
      $locale_char_set = 'utf-8';
   }
   return $locale_char_set == 'utf-8' ? strlen(utf8_decode($str)) : strlen($str);
}

function w2PUTF8substr($str, $start, $length = null) {
   global $locale_char_set;

   if (!$locale_char_set) {
      $locale_char_set = 'utf-8';
   }
   if ($locale_char_set == 'utf-8') {
      return ($length === null) ? 
                  utf8_encode(substr(utf8_decode($str), $start)) :
                  utf8_encode(substr(utf8_decode($str), $start, $length));
   }
   else {
      return ($length === null) ? 
                  substr($str, $start) :
                  substr($str, $start, $length);
   }
}


these functions are to be added in main_functions.php
View user's profile Send private message
 PostPosted: Mon Jun 22, 2009 5:08 am Reply with quote  
Message
  Ixai
I found the fountain of youth!

Joined: 18 Jan 2008
Posts: 15
I'm sorry for bringing a dead topic back but I was wondering... w2p 1.0 has been released and I don't see any of this in the code... did you ignored it for a specific reason?
View user's profile Send private message
 PostPosted: Mon Jun 22, 2009 12:44 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
Ixai wrote:
I'm sorry for bringing a dead topic back but I was wondering... w2p 1.0 has been released and I don't see any of this in the code... did you ignored it for a specific reason?


Yes - http://bugs.web2project.net/view.php?id=193 - it's not a matter of ignoring them, it's a matter of not having the people to test proper usage of non-English character sets.

It sounds like we have the proper people involved to test these changes (woohoo!), so any feedback, adjustments, etc that might be applicable, please share them here or on that issue and we'll adjust accordingly.

Thanks Smile

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Mon Jun 22, 2009 6:33 pm Reply with quote  
Message
  Ixai
I found the fountain of youth!

Joined: 18 Jan 2008
Posts: 15
Well I'll be testing this for you since I just installed w2p for a startup I'm planning with some college friends (one last try before graduation Razz). I'll keep track on Mantis.
View user's profile Send private message
 PostPosted: Wed Aug 05, 2009 8:17 am Reply with quote  
Message
  chris-ath
I want to know more...

Joined: 04 Aug 2009
Posts: 2
Hello Eureka,

I was try the modifications that you propose, without success with the gantt chart.
Can you please attach the modified files to help me with my problem?

Best regards,
Chris



utf-8.png
 Description:

Download
 Filename:  utf-8.png
 Filesize:  4.22 KB
 Downloaded:  301 Time(s)

View user's profile Send private message
 PostPosted: Wed Aug 12, 2009 6:12 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
Hello Chris,

The vesion of jpgraph used by web2project does not support UTF-8.

in ui.class.php after
Code:
define('UI_OUTPUT_RAW', 0x20);

add this line :
Code:
define('UI_OUTPUT_GRAPH', 0x40);


and after :
Code:
         case UI_OUTPUT_RAW:
            $str = stripslashes($str);
            break;

add :
Code:
         case UI_OUTPUT_GRAPH:
            $str = stripslashes($locale_char_set=='utf-8' ? utf8_decode($str) : $str);
            break;


then replace all occurences of UI_OUTPUT_RAW by UI_OUTPUT_GRAPH in modules/projects/gantt.php, modules/projects/vw_sub_projects_gantt.php and modules/tasks/gantt.php

I hope that caseydk will integrate this modification in release 1.1
View user's profile Send private message
 PostPosted: Sun Aug 16, 2009 10:10 am Reply with quote  
Message
  chris-ath
I want to know more...

Joined: 04 Aug 2009
Posts: 2
Hello eureka,

Thank you for your prompt reply.
I tried it but without any result. If you have another one solution, I would appreciate it.

Thanks a lot.
View user's profile Send private message
 PostPosted: Sun Aug 16, 2009 10:31 am Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
Hello chris-ath,

This works for me !

For you, try to use another font (Arial) for greek characters, adapt web2projectdev\lib\jpgraph\src\jpg-config.inc and use ISO-8859-7 instead of ISO-8859-1
View user's profile Send private message
 PostPosted: Sun Aug 16, 2009 7:10 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
eureka wrote:
I hope that caseydk will integrate this modification in release 1.1


Eureka,

This is on my todo list for today. I'll update the Mantis issue so you can test it out once it's available.

Thanks.

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Mon Aug 17, 2009 12:26 am Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
eureka wrote:

I checked all the string functions that contain constant arguments (except 0) so:
(snip)
these functions are to be added in main_functions.php


The last of these changes have been added in r565.

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Fri Sep 18, 2009 9:16 pm Reply with quote  
Message
  eureka
All I wanna do is to be here!

Joined: 22 Feb 2009
Posts: 28
Location: France
Hello,

These instructions can corrupt UTF-8 strings:

Code:
projectdesigner/gantt.php
374: $caption = substr($caption, 0, strlen($caption) - 1);

projectdesigner/projectdesigner.class.php
375: $alt = w2PUTF8strlen($a['task_description']) > 80 ? substr($a['task_description'], 0, 80) . '...' : $a['task_description'];

projectdesigner/vw_actions.php
216: $task_data['task_name'] = w2PUTF8strlen($task_data[1]) > 45 ? substr($task_data['task_name'], 0, 45) . "..." : $task_data['task_name'];

projects/projects.class.php
131: if (strlen($this->project_short_name) > 10) {
132:   $this->project_short_name = substr($this->project_short_name, 0, 10);

projects/vw_logs.php
120:   $descrip = substr($descrip, 0, $tranpos);
121:   $tranpos = strpos($row['task_log_description'], $transbrk);
122:   $transla = substr($row['task_log_description'], $tranpos + strlen($transbrk));
123!   $transla = trim(str_replace("'", '"', $transla));

tasks/addedit.php
87: $task_data['task_name'] = strlen($task_data[1]) > 45 ? substr($task_data['task_name'], 0, 45) . '...' : $task_data['task_name'];

tasks/gantt.php
454:       $caption = substr($caption, 0, strlen($caption) - 1);

tasks/vw_logs.php
111:   $descrip = substr($descrip, 0, $tranpos);
112:   $tranpos = strpos($row['task_log_description'], $transbrk);
113:   $transla = substr($row['task_log_description'], $tranpos + strlen($transbrk));
View user's profile Send private message
 PostPosted: Sat Sep 19, 2009 7:22 pm Reply with quote  
Message
  pedroa
Site Admin

Joined: 27 Oct 2007
Posts: 725
Location: Portugal
This discussion is following on this bug report:
http://bugs.web2project.net/view.php?id=269

About chris problem, jpgraphs internal fonts do not support UTF characters so you need to use an Arial font instead.
Either way, sooner or later jpgraph is going to be deprecated from web2Project.

Pedro A.

_________________
Peace!
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    web2Project Forum Index » web2Project BETA Testing

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Macinscott 2 by Scott Stubblefield

Get web2Project at SourceForge.net. Fast, secure and Free Open Source software downloads