Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Labels/caption in UTF-8

  • JoomlaWorks
  • JoomlaWorks's Avatar Topic Author
  • Offline
  • Admin
More
16 years 11 months ago - 16 years 8 months ago #9749 by JoomlaWorks
Labels/caption in UTF-8 was created by JoomlaWorks
Open up the file mambots/content/plugin_jw_sigpro.php and do a search for:
htmlentities($labels[md5($mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a])],ENT_QUOTES)

2 instances will be found. Replace them with this:
htmlentities($labels[md5($mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a])],ENT_QUOTES, 'UTF-8')

This should work now.

BTW, encoding issues have been addressed in the upcoming 1.3 version.  ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
16 years 11 months ago #9750 by Keith Miller
Replied by Keith Miller on topic Captions with special ? Characters
::)
I cannot get captions to work half the time. If I go in and delete all the CR/LF etc. (even though they don't appear to exist) then it will finally work. I can't figure out what it likes and doesn't like. And if I put a $ character in there forget it. Totally screwed up. Anyone know what is going on here?

And how to I create a new thread in this forum? All I can find is how to reply to someone else's post.

KR

Please Log in or Create an account to join the conversation.

More
16 years 10 months ago #9751 by Colin Mercer
Replied by Colin Mercer on topic Re: Labels/caption in UTF-8
Is the code secret?  Fotis cannot see your solution but really would like to as I have similar challenge.

Please Log in or Create an account to join the conversation.

More
16 years 10 months ago #9752 by Jamesmore
Replied by Jamesmore on topic Re: Labels/caption in UTF-8
great news about 1.3 will it use the new versions of moo tools and Slimbox :-)

Please Log in or Create an account to join the conversation.

More
16 years 9 months ago - 16 years 9 months ago #9753 by Rudialex
Replied by Rudialex on topic Re: Labels/caption in UTF-8
Hi. I'm russian speaking. And I had some problems with russian labels.

When we use this solution ... we get all russian translated to appropriate mnemonics ... (htmlentities function). It's not so big problem unless u use caption limit option ... say ... one letter become #74hfg; (sample). SO when you set limit ... function counts all symbols and say word from 5 letters becomes 25 mnemonic-symbol word. But, I didnt see any result anyway ... I didnt get my caption cut to limit amount. I saw an article that function str_word_count() that is used for removing letters works not good with languages different from EN. I was getting empty array here:
$word_arr = str_word_count($final_caption, 2);

So ... my way to make it working ...
htmlspecialchars($labels[md5($config->rdg_abspath.DS.$_images_dir_.DS.$images[$a])],ENT_QUOTES,$lng->iso)
// changed htmlentities to htmlspecialchars, dont think it's very important
// to yse htmlentities
//$lng->iso = 'windows-1251' - dont pay attention on this variable

And then trimming ...
if ($caption_limit) {
	$word_arr = preg_split('/ /', $final_caption, -1, PREG_SPLIT_OFFSET_CAPTURE);
	//$word_arr = str_word_count($final_caption, 2);
	foreach ($word_arr AS $v) {
		if (($v[1]+strlen($v[0])) > $caption_limit) {
			$final_caption = substr($final_caption, 0, $v[1]).'...';
			break;
		}
	}
}

Actually, I'm pretty sure this way to trim letter will work better ... and good with non EN letters.

So... this is the way I made it working with russian.

Please Log in or Create an account to join the conversation.

More
16 years 8 months ago #9754 by isranet
Replied by isranet on topic Re: Labels/caption in UTF-8

Open up the file mambots/content/plugin_jw_sigpro.php and do a search for:

htmlentities($labels[md5($mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a])],ENT_QUOTES)

2 instances will be found. Replace them with this:
htmlentities($labels[md5($mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a])],ENT_QUOTES, 'UTF-8')

This should work now.

BTW, encoding issues have been addressed in the upcoming 1.3 version.  ;)


Not works in v1.2.1

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum