Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

French charset?


20 replies to this topic

#1 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 03 September 2011, 18:11

I created a file called french.php but when the page loads all the text with accents is converted:
eg Bonjour invité! Désirez-vous vous identifier ou créer un compte?

I saved the file as UTF8.

Any ideas on what I have to change?

#2 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 03 September 2011, 18:50

For starters the pages you link to are not accessible:
403 Forbidden

You are not allowed to access this page. Possible problems:
[*]Missing index file
[*]Misconfigured mod_rewrite settings in .htaccess
[*]Authentication Failure
[*]Incorrect file or folder permissions


#3 MrPhil

  • Community Member
  • 3,294 posts
  • Real Name:Phil
  • Gender:Male

Posted 04 September 2011, 00:23

What character encoding is specified? If your accented characters are UTF-8, does the language file specify that? Your text looks like UTF-8 displayed as a single byte encoding such as ISO-8859-1 (Latin-1). When you "created" french.php, did you convert something like english.php? The default for English is Latin-1.

If you think you have it specifying UTF-8, see what the page claims the encoding is. If it says UTF-8, do any other UTF-8 pages come through OK? Some servers are set to override encodings and use only Latin-1.

If your page is UTF-8 encoding, I take it that your database is also UTF-8? Exactly what version of osC are you running?

#4 Bjoie

  • Community Member
  • 1 posts
  • Real Name:Irene M

Posted 04 September 2011, 07:49

Bonjour qwerty,

In order to make all accents show correctly on your website you have to use " Bonjour invitée" et non "Bonjour invitée". You just have to replace all words containing "é" in you french.php file and others with "é". It's the only way it'll work correctly on your website.

Hope that helps

#5 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 09:22

View PostJan Zonjee, on 03 September 2011, 18:50, said:

For starters the pages you link to are not accessible:
403 Forbidden
 
You are not allowed to access this page. Possible problems:
[*]Missing index file
[*]Misconfigured mod_rewrite settings in .htaccess
[*]Authentication Failure
[*]Incorrect file or folder permissions
T
hat's because only I can access it from my IP at present preventing the site from being live.

#6 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 09:24

View PostMrPhil, on 04 September 2011, 00:23, said:

What character encoding is specified? If your accented characters are UTF-8, does the language file specify that? Your text looks like UTF-8 displayed as a single byte encoding such as ISO-8859-1 (Latin-1). When you "created" french.php, did you convert something like english.php? The default for English is Latin-1.

If you think you have it specifying UTF-8, see what the page claims the encoding is. If it says UTF-8, do any other UTF-8 pages come through OK? Some servers are set to override encodings and use only Latin-1.

If your page is UTF-8 encoding, I take it that your database is also UTF-8? Exactly what version of osC are you running?
I
simply copied english.php and renamed it french.php but when I edited it, I made sure it saved at UTF8.I am ru
nning 2.2 RC1The char
acter encoding of FF says Western 8859. As soon as I change it to UTF8 it works correctly but how do I make the page run as UTF8?

#7 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 04 September 2011, 09:48

What is wrong with saving your french.php as iso-8859-1 (Latin 1)? As Phil explained using UTF-8 for your site needs a number of things: the webserver should use UTF-8 instead of iso-8859-1, your settings should say it is UTF-8 (probably not so important) and very important your database in this case should be set to utf-8 also as well as the content of the database should be converted to UTF-8.

All in all it looks like the easiest solution in this case is to save your french.php as iso-8859-1 and forget about UTF-8.

#8 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 10:23

That seems to work - thanks.
Can I delete the english.php and english folder and simply have francais.php and francais folder only? This site does not need other languages.
Also, there seems to be a 2nd english.php file in /cart/includes - does that need to be changed also? It seems strange to have 2 of them when everything could be put into one language file.

#9 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 10:50

I am now trying to save a file with an escape character in ISO8859 but it will not save.
Any ideas why?
It says the document has characters that are not compatible. It cuts the text off at the first \

<?php
/*
  $Id: $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2007 osCommerce

  Released under the GNU General Public License
*/

define('TEXT_MAIN', '
<hr>
<b style="color: rgb(7,75,138);">
Proxyplayer vous offre l\&#8217;acc&#232;s &#224; des serveurs proxy et r&#233;seau priv&#233; virtuel (VPN) pour une grande vari&#233;t&#233; d&#8217;utilisations telles que :<br />
<br />
- acc&#232;s s&#233;curis&#233;<br />
- navigation sur internet<br />
- navigation anonyme<br />
- visualisation de vid&#233;os<br />


#10 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 11:18

above should be a sbelow, without the html chars
Edit: it keeps chagning them to html chars

<?php
/*
  $Id: $
 
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
 
  Copyright (c) 2007 osCommerce
 
  Released under the GNU General Public License
*/
 
define('TEXT_MAIN', '
<hr>
<b style="color: rgb(7,75,138);">
Proxy vous offre l\&#8217;acc&#232;s &#224; des serveurs proxy et r&#233;seau priv&#233; virtuel (VPN) pour une grande vari&#233;t&#233; d&#8217;utilisations telles que :<br />
<br />
- acc&#232;s s&#233;curis&#233;<br />
- navigation sur internet<br />
- navigation anonyme<br />
- visualisation de vid&#233;os<br />
- etc.<br />
<br />

Edited by qwertyjjj, 04 September 2011, 11:19.


#11 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 04 September 2011, 13:14

There are solutions for converting an UTF-8 file to an iso-8859-1 file because you are right, I remember this happening with text editors. But isn't it easier to start with a French language pack such as this or this one and add only the translations (for other addons) you need to those files?

If you want to delete the english files you also need to remove the English language in your admin.

#12 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 13:48

View PostJan Zonjee, on 04 September 2011, 13:14, said:

There are solutions for converting an UTF-8 file to an iso-8859-1 file because you are right, I remember this happening with text editors. But isn't it easier to start with a French language pack such as this or this one and add only the translations (for other addons) you need to those files?

If you want to delete the english files you also need to remove the English language in your admin.

I have made quite a few customisations so I thought it wouldn't take that long just to change all the files in the language folder and go from there.

I get this error:
iconv --from-code=UTF-8 --to-code=ISO-8859-1 english2.php > newfile.php
iconv: illegal input sequence at position 266
j@j-Inspiron-9300:~/Desktop/PP$

Edited by qwertyjjj, 04 September 2011, 13:51.


#13 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 04 September 2011, 13:52

Perhaps this page is helpful.

#14 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 04 September 2011, 14:28

View PostJan Zonjee, on 04 September 2011, 13:52, said:

Perhaps this page is helpful.

errors at the slash for some reason?

<?php
/*
$Id: $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2007 osCommerce

Released under the GNU General Public License
*/

define('TEXT_MAIN', '
<hr>
<b style="color: rgb(7,75,138);">
Proxy vous offre l\

iconv: illegal input sequence at position 266

Edited by qwertyjjj, 04 September 2011, 14:28.


#15 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 04 September 2011, 14:49

View Postqwertyjjj, on 04 September 2011, 14:28, said:

errors at the slash for some reason?

iconv: illegal input sequence at position 266
Not a clue, but I would say, retype that character (or delete it) and try again.

#16 MrPhil

  • Community Member
  • 3,294 posts
  • Real Name:Phil
  • Gender:Male

Posted 04 September 2011, 15:20

All Latin-1 (Western, 8859-1) characters are found in UTF-8, but there are many UTF-8 characters not found in Latin-1. Perhaps you used one of them? That would prevent the file from being converted to Latin-1. Or, the input file just got corrupted at some point, or iconv's encoding tables are corrupted.

#17 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 15 September 2011, 09:25

What file can I set the database charset in?
I have changed header.php to use utf8 but some db characters still show oddly. I need to use mysql_set_charset somewhere

#18 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 15 September 2011, 11:25

This is just odd. database is in UTF8, when I view the product categories, they are saved with accents, the page loads in UTF8 but when I view the page it replaces all accents with odd characters.

#19 MrPhil

  • Community Member
  • 3,294 posts
  • Real Name:Phil
  • Gender:Male

Posted 16 September 2011, 01:50

If your database is putting out UTF-8 characters, the language support files will have to be UTF-8, as must be the page display encoding. Check that your page is putting out a meta tag with charset UTF-8. If it is, go to View > Character Encoding (or the equivalent on your browser) and see what the browser thinks the encoding is. If it's not UTF-8, tell the browser to force the display of the page in UTF-8 and see if it looks OK. If it does, the problem is that your host is messed up, and the server is overriding whatever encoding you specify with Latin-1.

#20 qwertyjjj

  • Community Member
  • 268 posts
  • Real Name:qwertyjjj

Posted 16 September 2011, 09:04

meta is UTF-8, db is in UTF-general, there is no UTF-8 option.
Page and browser think it is UTF 8.
When I change it to WEstern ISO, it displays the characters correctly but inthe database they are saved with accents.
The categories.php page where I save the catalog entries is displayed in Wester-ISO for some reason. How do I change that?

Edited by qwertyjjj, 16 September 2011, 09:06.