About arrow Support Forums Make Text BiggerMake Text SmallerReset Text Size
Export Content Support
Welcome, Guest
Please Login or Register.    Lost Password?
Re:utf8 support? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:utf8 support?
#1151
jaleo (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months, 1 Week ago Karma: 0  
i cant read it after i choose traditional chinese encode,
i have send you email today. please check it.
Thanks.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1153
Steve (Admin)
Admin
Posts: 222
graph
User Online Now Click here to see the profile of this user
Re:utf8 support? 10 Months, 1 Week ago Karma: 3  
I have just had a look at the generated sql and can see what the problem is.

Export content assumes that content compiled on Joomla 1.0+ is not utf8 and will attempt to convert it over.

So on the source site if you go to:
/administrator/components/com_export_content/convert_img.php
This is where all the character conversions take place when you press the compile buttons.

You will see about line 23 function numeric_html($text){ this function goes down to about line 2208 you need to remove everything in between as shown below:

Code:

function numeric_html($text){ REMOVE CODE return strtr($text, $cr); //return $text; }
And then just under that about line 2210 you will see:
Code:

/**************************************** High end numeric converter ******************************************/ function high_order($text){ $text = preg_replace('/([\xc0-\xdf].)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'", $text); $text = preg_replace('/([\xe0-\xef]..)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'", $text); return $text; }
Change this to:
Code:

function high_order($text){ return $text; }
Once you change this it should compile all your Chinese characters as they are now in the source site. Please let me know how you go.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/03/08 01:49 By Steve.
 
Regards Steve.
  The administrator has disabled public write access.
#1154
jaleo (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months, 1 Week ago Karma: 0  
Export empty content.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1155
montemedia (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 0  
Hello Steve,

The same situation is here. Now I can install exported content, but, actually, there is nothing to import - no content.

I have searched through my previously exported content and have noticed a lot of strange characters, with no special rule to repeat.
I have compared it with UTF-8 table I have, a lot of them does not have responding numeric code.

As far as my language is concerned, and the most of Middle EU countries, we need only 10-12 characters: ž, , , š,  and responding capital letters.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1159
Steve (Admin)
Admin
Posts: 222
graph
User Online Now Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 3  
Sorry it took so long to get back guys I have been very busy with paid work.
jaleo
Sorry the first one should look like this:
Code:

function numeric_html($text){ REMOVE CODE return $text; }
And the second like this:
Code:

function high_order($text){ return $text; }
That should bypass any character conversion. montemedia You will need to add a bit of code because when moving to Joomla 1.0+ series we are using an XML install and XML will not parse certain characters so they must be converted. So if you only want to move Serbian, Croatian, Montenegrin you need change the first function like so:
Code:

function numeric_html($text){ REMOVE CODE return $text; }
If you paste it in make sure you don't leave the "REMOVE CODE" text there. And the second one like this:
Code:

/**************************************** High end numeric converter ******************************************/ function high_order($text){ $text = preg_replace('/([\xc0-\xdf].)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'", $text); $text = preg_replace('/([\xe0-\xef]..)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'", $text); return $text; }
You should just copy-paste the attached code and replace the above function in convert_img.php. http://www.bestdownloadsites.com/export_content/images/fbfiles/files/ Serbian-Croatian-Montenegrin.txt
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/03/09 19:22 By Steve.
 
Regards Steve.
  The administrator has disabled public write access.
#1161
montemedia (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 0  
Excuse me, Steve... where is the "Attached code"?

EDIT: URL with code suddenly appeared Thanks, I will try and inform you.

EDIT 2: Sorry Steve, again - nothing to import.
How to say... XML generates exact number of articles, but nothing inside - neither title, nor content.
I edited your txt file, adding some " ' " characters in front of Central European letters.
BTW, this is for Slovenian and Bosnian language, too. I am not sure about Slovak and Czech language, but I will check it up and inform you.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/03/09 19:58 By montemedia.
  The administrator has disabled public write access.
#1162
montemedia (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 0  
Both Czech and Slovak are a little bit different regarding letter than Serbian, Slovenian, Croatian, Bosnian and Montenegrin.

I played a bit with your codes and tips: I added letter replacements in first edited part, and I have got both content and titles.
But, encoding is not good.
We have to put "something" between lines 23 and 24

Code:

function numeric_html($text){ PUT SOMETHING HERE, BUT NOT THIS: //start of not this $cr=array( //Serbian, Croatian, Montenegrin, Bosnian, Slovenian ' ' => ' ', ' ' => ' ', '' => '', '' => '', '' => '', '' => '', 'Š' => '`', 'š' => 'a', 'Ž' => '}', 'ž' => '~' ); $text= strtr($text, $cr); return $text; } // end of not this return $text; }
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1163
jaleo (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 0  
Thanks,Steve

It works now.
This is a great component.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1167
Steve (Admin)
Admin
Posts: 222
graph
User Online Now Click here to see the profile of this user
Re:utf8 support? 10 Months ago Karma: 3  
QUOTE:
Thanks,Steve

It works now.
This is a great component.


Glad to hear you got it working jaleo .

montemedia

I have made changes to the text file.

Try removing everything in function numeric_html($text){} so it looks like this:

Code:

function numeric_html($text){ return $text; }
And then just replace this with the code in the text file:
Code:

/**************************************** High end numeric converter ******************************************/ function high_order($text){ $text = preg_replace('/([\xc0-\xdf].)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'", $text); $text = preg_replace('/([\xe0-\xef]..)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'", $text); return $text; }
If this is still no good it shows where to remove code in the text file.
 
Report to moderator   Logged Logged  
 
Regards Steve.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop