|
|
|
utf8 support? (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: utf8 support?
|
jaleo (User)
Fresh Boarder
Posts: 7
|
|
Re:utf8 support? 9 Months ago
|
Karma: 0
|
|
i cant read it after i choose traditional chinese encode,
i have send you email today. please check it.
Thanks.
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
Steve (Admin)
Admin
Posts: 207
|
|
Re:utf8 support? 9 Months 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. 
|
|
|
|
|
|
|
Last Edit: 2008/03/08 01:49 By Steve.
|
|
|
Regards Steve.
|
|
|
The administrator has disabled public write access.
|
jaleo (User)
Fresh Boarder
Posts: 7
|
|
Re:utf8 support? 8 Months, 4 Weeks ago
|
Karma: 0
|
|
Export empty content.
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:utf8 support? 8 Months, 4 Weeks 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.
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
Steve (Admin)
Admin
Posts: 207
|
|
Re:utf8 support? 8 Months, 4 Weeks 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
|
|
|
|
|
|
|
Last Edit: 2008/03/09 19:22 By Steve.
|
|
|
Regards Steve.
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:utf8 support? 8 Months, 4 Weeks 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.
|
|
|
|
|
|
|
Last Edit: 2008/03/09 19:58 By montemedia.
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:utf8 support? 8 Months, 4 Weeks 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;
}
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
jaleo (User)
Fresh Boarder
Posts: 7
|
|
Re:utf8 support? 8 Months, 4 Weeks ago
|
Karma: 0
|
|
Thanks,Steve
It works now.
This is a great component.
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
Steve (Admin)
Admin
Posts: 207
|
|
Re:utf8 support? 8 Months, 3 Weeks 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.
|
|
|
|
|
|
|
Regards Steve.
|
|
|
The administrator has disabled public write access.
|
|
|
|
|
|
|