By Guest on Wednesday, 17 February 2016
Replies 19
Likes 0
Views 1.3K
Votes 0

PHP Version : 5.5.31
MySQL Version : 5.5.47-cll
Server Information : Linux cp125.webempresa.eu 2.6.32-531.29.2.lve1.3.11.1.el6.x86_64 #1 SMP Thu Dec 18 06:49:17 EST 2014 x86_64
Fix jQuery? : Yes
Load JEvents Bootstrap CSS? : Yes
Max Input Vars ? : 1000
Club code set? : No
User Agent : Mozilla/5.0 (Windows NT 5.1; rv:44.0) Gecko/20100101 Firefox/44.0
Joomla : 3.4.8
component_com_jevents : 3.4.4
component_com_jce : 2.3.2.4
module_mod_jevents_cal : 3.4.4
module_mod_jevents_custom : 3.4.4
module_mod_jevents_filter : 3.4.4
module_mod_jevents_latest : 3.4.4
module_mod_jevents_legend : 3.4.4
module_mod_jevents_switchview : 3.4.4
plugin_content_jevents : 3.4.4
plugin_finder_jevents : 3.4.4 (not enabled)
plugin_search_eventsearch : 3.4.4
plugin_system_gwejson : 3.4.4

Hi,
I'm using jevents linked to google calendar. One of the calendars is wroten in catalonian language, and it includes some characters like: à, è, ò.

When google calendar imports the event detail from google calendar, the text is cut for this characters.

for example, if event detail is: "Demà anirem allí", the event details imported by jevents is this: "Dem"

thanks in advance!!
P
Hello P,

Could you please provide a copy of your Google eXport?

Thanks
Tony
·
Wednesday, 17 February 2016 22:28
·
0 Likes
·
0 Votes
·
0 Comments
·
The google export calendar is in this link:

https://calendar.google.com/calendar/ic ... /basic.ics
·
Saturday, 20 February 2016 00:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Do you have PHPMyAdmin?

Can you check your JEvents Database Tables are in the UTF8 collation?

Many thanks
Tony
·
Saturday, 20 February 2016 22:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Tonyp,

I think this is ok. At phpmyadmin you can see: utf8_general_ci (see attachment)
·
Sunday, 21 February 2016 17:23
·
0 Likes
·
0 Votes
·
0 Comments
·
That's ok, can you go into each table and check the column collations?

Many thanks
Tony
·
Sunday, 21 February 2016 19:40
·
0 Likes
·
0 Votes
·
0 Comments
·
all columns of type varchar, text and longtext have the same collation: "utf8_general_ci"
·
Sunday, 21 February 2016 20:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

We are looking into this. I will update you when we have a solution.

Many thanks
Tony
·
Monday, 22 February 2016 10:13
·
0 Likes
·
0 Votes
·
0 Comments
·
In the file components/com_jevents/libraries/iCalImport.php change line c. 396 from
if (JString::strpos(str_replace(" ","",JString::strtolower($value)),"<ahref=")===false && JString::strpos(str_replace(" ","",JString::strtolower($value)),"<img")===false){

to
if (JString::strpos(str_replace(" ","",JString::strtolower($value)),"<ahref=")===false && JString::strpos(str_replace(" ","",JString::strtolower($value)),"<img")===false && (JString::strpos(JString::strtolower($value),"http://")!==false || JString::strpos(JString::strtolower($value),"https://")!==false)){
]

That should resolve the issue
·
Monday, 22 February 2016 17:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Tonyp and Geraint for your help, but it don't solve the problem.

I've replaced the line of code in components/com_jevents/libraries/iCalImport.php

Event description is cut for this characters: à, è, ò
·
Tuesday, 23 February 2016 16:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Can you try one further amendment change line 397 from
$value = preg_replace('@(https?://([\w-.]+)+(:\d+)?(/([\w/_\.%\-+~=]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $value);


to
$value = preg_replace('@(https?://([\w-.]+)+(:\d+)?(/([\w/_\.%\-+~=]*(\?\S+)?)?)?)@u', '<a href="$1">$1</a>', $value);
·
Wednesday, 24 February 2016 10:12
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm sorry, it doesn't work!
·
Wednesday, 24 February 2016 17:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Which event in the import specifically isn't working. In my tests on the feed you gave above the events all imported fine.
·
Thursday, 25 February 2016 08:23
·
0 Likes
·
0 Votes
·
0 Comments
·
I've asked to my customer to avoid words with special characters.

Now, I've added the word "xmàs" at the end of the event description on march 1st. If you import this calendar:

https://calendar.google.com/calendar/ic ... /basic.ics

you will see that the word "xmàs" is imported like "xm" at the end of the event, as you can see here:

http://patrimoni.peu-uji.es/ca/agenda/i ... er_reset=1
·
Thursday, 25 February 2016 16:55
·
0 Likes
·
0 Votes
·
0 Comments
·
I had the same problem on my Jevents 3.4.4 instalaltion: imported events from google have description truncated when some UTF caracters are present (some, not all).
I solved replacing the iCalImport.php file with the one from jevents 3.2.21
Hope this information can help.
Luigi
·
Friday, 26 February 2016 08:37
·
0 Likes
·
0 Votes
·
0 Comments
·
It looks like a change we put in the code to handle badly encoded data from Microsoft calendars is causing a problem here.

Please change lines c. 404-411 from
				if ($key=="DESCRIPTION" || $key=="SUMMARY"){
$len = JString::strlen($value);
$ulen = JString::strlen($value);
// Can cause problems with multibyte strings so skip this
if ($len == $ulen){
$value =str_replace(array("\205","\221","\222","\223","\224","\225","\226","\227","\240"),array("...","'","'",'"','"',"*","-","--"," "),$value);
}
}

to
				if ($key=="DESCRIPTION" || $key=="SUMMARY"){
$len = strlen($value);
$ulen = JString::strlen($value);
// Can cause problems with multibyte strings so skip this
// we need to check this since some UTF-8 characters from Google get truncates otherwise
if ($len == $ulen){
$value =str_replace(array("\205","\221","\222","\223","\224","\225","\226","\227","\240"),array("...","'","'",'"','"',"*","-","--"," "),$value);
}
}
·
Friday, 26 February 2016 09:52
·
0 Likes
·
0 Votes
·
0 Comments
·
I confirm that google calendar import is working correctly with the provided modification.
thanks a lot
Luigi
·
Friday, 26 February 2016 12:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Great to hear Luigi,

Thanks for letting us know!
·
Monday, 29 February 2016 09:00
·
0 Likes
·
0 Votes
·
0 Comments
·
It's running perfect!

thanks!!
·
Tuesday, 01 March 2016 19:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Great to hear!!
·
Tuesday, 01 March 2016 21:52
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post