Support Forums

charset / encoding issues (utf-8 � iso-8859-2)

This is a discussion on charset / encoding issues (utf-8 � iso-8859-2) within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Try adding PHP Code: header  ( 'Content-type: text/html; charset=utf-8' );  in the corresponding PHP files. For example: printer.php private.php terms.php modules.php viewimage.php ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 10-26-2008, 09:05 AM   #41
Customer
 
Join Date: May 2008
Posts: 68
Rep Power: 19
SecondShoe is just really nice SecondShoe is just really nice
Default

Try adding
PHP Code:
header ('Content-type: text/html; charset=utf-8'); 
in the corresponding PHP files. For example:
printer.php
private.php
terms.php
modules.php
viewimage.php

Also open external.php and find iso-8859-1, replace with utf-8.
To be sure convert those files encodind to UTF-8 using some text editor.
SecondShoe is offline   Reply With Quote
Old 10-26-2008, 09:22 PM   #42
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 293
Rep Power: 23
hel68c is just really nice hel68c is just really nice
Default

I found the problem.

All my page are edit with Dreamweaver. I change the page properties in Modify menu and change document encoding for unicode (UTF-8), Save and everything appear ok online. I change back all the code in french.php (â for � etc..)

Thanks for your help
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 10-28-2008, 05:24 AM   #43
Customer
 
Join Date: Dec 2006
Posts: 112
Rep Power: 23
darek is on a distinguished road
Default

hel68c, I am not sure what program you use to write your french.php file but you should know that probably any txt file (like php) already have chairset, when you open a php file in dreamweaver and create a new file you creat a file with a chaiset, you set it with Edit/Preferences, it doesn't matter if the file has, or don't have
PHP Code:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> 
, it still has encoding,
when you open any txt, php file with dreamweaver you have top part for code and bottom part for display, when you right click the display part at the bottom you have Page Properties, then in Page Properties you have Title/Encoding feature - this should be changed to UTF-8 in any file that uses national charcters - in any template.tpl, any php file that uses national charcters including your french.php

and don't forget this
PHP Code:
// english.php
ini_set('default_charset''UTF-8');
// Set the PHP locale to English
//setlocale(LC_ALL, 'pl_PL.UTF-8');
//setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
setlocale(LC_TIME'en_US.UTF-8'); 
PHP Code:
polski.php
ini_set
('default_charset''UTF-8');
// Set the PHP locale to English
//setlocale(LC_ALL, 'pl_PL.UTF-8');
//setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
setlocale(LC_TIME'pl_PL.UTF-8'); 
the above are mine settings for english.php and polski.php (I have language change on my page) othewise polish characters didn't display in viewlisting.php - some of my clients my use polish, but, by having
PHP Code:
setlocale(LC_TIME'en_US.UTF-8'); // for english
setlocale(LC_TIME'pl_PL.UTF-8'); // for polish 
I have time translation for both langages
darek is offline   Reply With Quote
Old 10-29-2008, 05:40 AM   #44
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 293
Rep Power: 23
hel68c is just really nice hel68c is just really nice
Default

Thank you Darek for this help.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 10-29-2008, 06:18 AM   #45
Customer
 
Join Date: Dec 2006
Posts: 112
Rep Power: 23
darek is on a distinguished road
Default

let us know if this was the problem
the code I wrote works for me

you may still issue some problems and you may need to dig the code to remove some UTF-8 calls (I had to do it for pages I think or something) but generally all works fine for me, and my langage is not any better than yours - lots of problems
darek is offline   Reply With Quote
Old 10-29-2008, 10:06 AM   #46
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 293
Rep Power: 23
hel68c is just really nice hel68c is just really nice
Default

I only changed my properties in Dream Weaver and everything display correctly. Except the Extra fields in Vewlistings2.tpl. So I changed

PHP Code:
this line 
$objValue 
htmlentities($objValueENT_QUOTES'UTF-8');
For 
This
$objValue 
htmlspecialchars($objValueENT_QUOTES'UTF-8'); 
Now all the French's characters display correctly.

Thanks Again
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 10-29-2008, 10:37 AM   #47
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,492
Rep Power: 88
seymourjames is a jewel in the rough
Default

So in conclusion you kept everything as standard UTF-8 everywhere but made sure dreamweaver was set to UTF-8 as well. The only small problem you had was to make that change for extra fields.

If that is the case, very well done. I will have to do that with my French site.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 10-29-2008, 12:20 PM   #48
Customer
 
Join Date: Dec 2006
Posts: 112
Rep Power: 23
darek is on a distinguished road
Default

and all solved!
yes UTF-8 works perfect, but those little pieces of code need to be changed too

and all will work nice as long as you remember about the coding when editing pagies using special characters
darek is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
& and & encoding searchresults seymourjames Technical Support 2 08-06-2008 06:55 AM


All times are GMT -4. The time now is 11:25 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0