What is envolved in modifiing a component to work in Japanese?

Locked
Akumaownz
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Tue Dec 26, 2006 1:44 am

What is envolved in modifiing a component to work in Japanese?

Post by Akumaownz » Sun Mar 11, 2007 3:33 am

What is evolved in modifying a component to work in Japanese?. I understand that it needs to run in UTF-8 but where do I set this to force to code to run in UTF-8. I know with asp this is done with . Does php have something similar??

Many thanks

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Mon Mar 19, 2007 11:35 pm

I would like to know the answer to this too.  I am working with the Cinema componet and having trouble with odd characters showing up.
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!

zippo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Nov 18, 2006 3:33 am
Location: Japan

Re: What is envolved in modifiing a component to work in Japanese?

Post by zippo » Fri Mar 23, 2007 2:29 pm

Do you use apache2 ?

If you use apache2 ,please try the setting in httpd.conf or .htaccess as below.

AddDefaultCharset Off

And check the mbstring module of PHP is enabled.

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Fri Mar 23, 2007 3:07 pm

Using apache 1.3.37 - mbstring is enabled.
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!

zippo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Nov 18, 2006 3:33 am
Location: Japan

Re: What is envolved in modifiing a component to work in Japanese?

Post by zippo » Sun Mar 25, 2007 5:33 am

hello computerlady911,
computerlady911 wrote: I would like to know the answer to this too.  I am working with the Cinema componet and having trouble with odd characters showing up.
When the trouble with odd charactoers were shown, wich charset did show in your site html source code ?

and which character encode was used in your www browser ?

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Mon Mar 26, 2007 4:13 pm

UTF8 in both cases.  I will note that this particular componpontent has a line that cuts off the text after so many characters.  Here is an example ofthe code.  I think it does not know how to tell when a Japanese word ends.  Perhaps I could replace the code so it reads, cut off after x number of words.

Code: Select all

 $line=1;
  foreach($rows as $row1) {
    $text=substr ($row1->imgtext, 0, $cin_testolista);
    $linecolor = ($line % 2) + 1;
    echo "<tr class='$cin_line".$linecolor."'><td width='1%' align='center' valign='top'>";
    echo "<a href='".sefRelToAbs("index.php?option=com_cinema&Itemid=$Itemid&task=detail&id=$row1->id")."'><img src='$thumbnailpath$row1->imgthumbname' alt='$row1->imgtitle' width='60'   style=' border-left : 1px solid #fef; border-top : 1px solid #fef; border-right: 1px solid #eee; border-bottom: 1px solid #ddd; border-right-style: outset; border-bottom-style: outset'></a>";
    echo "<td width='99%'><a href='".sefRelToAbs("index.php?option=com_cinema&Itemid=$Itemid&task=detail&id=$row1->id")."'><strong>$row1->imgtitle</strong></a>";
    if ($cin_showdetail) echo "<span class='small'> "."  [ $row1->nazione ]</span>";
    echo "<br /><em>$row1->imgtitle2</em><br />";
    echo "$text...<br /><br />";
    echo "</td>";
    $line++;
  }
  echo "</tr></table>";
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!

zippo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Nov 18, 2006 3:33 am
Location: Japan

Re: What is envolved in modifiing a component to work in Japanese?

Post by zippo » Thu Mar 29, 2007 3:11 pm

Code: Select all

substr ($row1->imgtext, 0, $cin_testolista)
In deed,it is caused this code.
In UTF-8, The length of almost one Japanese malti-byte character is  3 byte.
but the length of one latin character is single byte.

So, if "$row1->imgtext" don't include latin characters, and if the value of $cin_testlista is multiple of 3,
it will be successful.

I had tested some mb_xxxx functions, but any function had been successful.

humm,,, this is difficult ...
Does anyone have  good idea ? ???

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Thu Mar 29, 2007 4:10 pm

I changed the settings so that the cuttoff number is a multiple of 3.  Some of the little questionmarks went away, but not all.  Any other suggestions?

This site can be view at: http://www.sandiegoyuyu.com/component/o ... /catid,76/
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!

zippo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Nov 18, 2006 3:33 am
Location: Japan

Re: What is envolved in modifiing a component to work in Japanese?

Post by zippo » Fri May 04, 2007 2:02 pm

I solve !  :laugh:

It needs 2 steps.

Step 1.
  in /component/com_cinema/cinemaviewcategory.php

  Change this code
 

Code: Select all

  $text=substr ($row1->imgtext, 0, $cin_testolista); 
  to
 

Code: Select all

 $text=mb_substr ($row1->imgtext, 0, $cin_testolista); 
Step 2.
    in .htaccess

    Add the following value

    php_value mbstring.internal_encoding  UTF-8

Please try  ;)

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Fri May 04, 2007 3:11 pm

Didn't work right.  The php string was allready in the htaccess file but was commented out.  I uncommented it and the entire site went down with a 500 error.  I tried the change to the component with out the htaccess seting and it worked but I am getting way more text than I want.

Still playing.
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!

computerlady911
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jan 01, 2007 5:13 am
Contact:

Re: What is envolved in modifiing a component to work in Japanese?

Post by computerlady911 » Fri May 04, 2007 3:25 pm

Acutally it did work.  I just need to change the Number of characters for Details: from 525 to 171.
Get a website today at Quik-Site.com.  Quick, easy, affordable and 100% Joomla compatible!


Locked

Return to “Japanese Forum”