Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

UK Locale Issue


JoeMcManus

Recommended Posts

Posted

Fellow coders...

 

I run 5 osCommerce shops and all work fine. Now I'm putting the 6th up on a different server and I'm getting this most annoying locale issue. Tried to fix things myself with the help of php.net, various Google search attempts and here but no joy.

 

This runs on Red Hat Enterprise Linux v3.

 

In /usr/lib/locale or when I type locale -a on my server I see, amongst many others, the following available locales:

 

en_GB

en_GB.iso885915

en_GB.utf8

 

I'm in the UK so I figure these are what I need.

 

My english.php, the relevant bits, looks like this:

 

// look in your $PATH_LOCALE/locale directory for available locales
// or type locale -a on the server.
// Examples:
// on RedHat try 'en_US'
// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'
@setlocale(LC_TIME, 'en_GB');
// charset for web pages and emails
define('CHARSET', 'ISO-8859-1');

 

I also tried:

@setlocale(LC_ALL, 'en_GB.iso885915');
// charset for web pages and emails
define('CHARSET', 'iso-8859-15');

 

and

 

@setlocale(LC_ALL, 'en_GB.utf8');
// charset for web pages and emails
define('CHARSET', 'UTF-8');

 

and many more. Inc their capitalized versions and other variations.

 

I keep getting ?'s instead of ?'s on the front end. Also when I go in the back-end to localization > currencies and change the symbol to ? it stores it in the database as "£" (without the "'s). I tried it with "£" but that messes up some parts like e-mails and my PDF stuff. The £ also messes up PDF even though it seems to work on the front and back-end. So I can get everything but the PDF to show ?.

 

So based on my server settings, what do you reckon my locale should be? Is PDF restricted in locale's?

 

Would appreciate your feedback.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Posted

@setlocale(LC_TIME, 'en_UK.ISO_8859-1');

 

and, further down:

 

// charset for web pages and emails

define('CHARSET', 'iso-8859-1');

 

Works for me!

 

Vger

Posted

I'll try that now, thanks. The reason I didn't try that yet is that underscore doesn't show on my server. When you do locale -a does it show the same ones as I listed?

 

BTW I don;t have en_UK in my locale folder. I do have uk_UA, whatever that may be.

 

I'll try en_GB.ISO_8859-1 now...

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Posted

That fixes the display in the front-end as well as the back-end. I made sure, before adding a test order, to type a pound sign into localization > currecnies > symbol so I knew the same charset was stored.

 

But it's not working for e-mail, the confirmation shows the weird A in front of the ? sign and my PDF invoice is also broken with the A in front of the ?.

 

Here's what I see when I use phpMyAdmin (I read that phpMyAdmin doesn't support UTF-8, so I assume it's the iso8895).

 

In currecies the symbol is stored as: £

In orders_total the 4 figures start with: £

 

If I change the currecy symbol in phpMyAdmin back to ? manually, the whole shop shows ?'s instead of ?'s but my PDF's do show correctly.

 

Such a headache this crap is.

 

Any other suggestions?

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Posted

Try this, as it may not be a database issue.

 

In includes/languages/english.php look for 'USD' and change to 'GBP' (the three letter symbol for UK Pounds)

 

Vger

Posted

It's already at GBP.

 

One thing that makes me wonder is the 'TIME' in @setlocale(LC_TIME, 'en_GB.ISO_8859-1');

 

This seems to restric to time settings. Is LC_ALL set somewhere in osCommerce or on the server? (I tried LC_ALL but same problems....)

 

The problem seems to be that it stores ? as £ in the database which shows fine on the website but not in e-mail or PDF. Changing £ in the database back manually to ? results in the hated ?'s showing everywhere.

 

Based on http://uk.php.net/manual/en/function.localeconv.php I tried echoing:

 

  <?php
 $locale_info = localeconv();
  print_r($locale_info);
 ?>

 

It results in:

 

Array ( [decimal_point] => . [thousands_sep] => [int_curr_symbol] => [currency_symbol] => [mon_decimal_point] => [mon_thousands_sep] => [positive_sign] => [negative_sign] => [int_frac_digits] => 127 [frac_digits] => 127 [p_cs_precedes] => 127 [p_sep_by_space] => 127 [n_cs_precedes] => 127 [n_sep_by_space] => 127 [p_sign_posn] => 127 [n_sign_posn] => 127 [grouping] => Array ( ) [mon_grouping] => Array ( ) )

 

That seems to hold some clues since the currency symbol is completely empty...

 

Should I just set LC_MONETARY in english.pgp as well to try?

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Posted

I have a similar problem...

 

I've deliberately set my httpd.conf to UTF-8 as I run a mixture of sites, inc 3 OSC shops, all in GBP...

 

The issue is, 4 other sites I run require UTF-8 to be set otherwise damn quotes and ' appear as 3 crazy greek looking chars.

 

So any ideas on this?! is there a way to FORCE OSC to be UTF compliant.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...