PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Internationalization » I18Nv2 » Bug #4222

Using locale with specific charset

Details

Request #4222Using locale with specific charset
Submitted2005-04-26 08:40 UTC
Fromlaurynas dot butkus at gmail dot com
StatusWont fix
PackageI18Nv2
PHP VersionIrrelevant
OSWindows
Roadmaps(Not assigned)

Comments

[2005-04-26 08:40 UTC] laurynas dot butkus at gmail dot com

Description:
------------
It would be very nice to be able to set locale charset to UTF8 or any other (as third parameter). Whole output conversion with ob_iconv is not suitable sometimes.

[2005-04-27 06:44 UTC] laurynas dot butkus at gmail dot com

example: my Lithuanian website is built using UTF-8 charset, when I do

$locale =& I18Nv2::createLocale("lt_LT");

I18Nv2 sets Lithuanian locale (successfully), but localized messaged are in ISO-8859-13 charset. I want them to be in UTF-8.

I18Nv2::autoConv('UTF-8');
is not for me as it converts all my site output (which is already in UTF-8).

I see in examples, that creating language with
$lang = &new I18Nv2_Language('it', 'iso-8859-1');
it's possible to specify preferred charset (second param).

It would be cool to be able to do the same when creating locale object or setting locale:

$locale =& I18Nv2::createLocale("lt_LT", "UTF-8");
or maybe even nicer
$locale =& I18Nv2::createLocale("lt_LT.UTF-8");

So I18Nv2 would automatically convert all messages to the specified charset.

I'm not sure if it's possible to detect in which charset localized system texts are. As I see you are getting them from the system using strftime. If it's not possible to detect the charset to convert from then it can be a problem...

[2005-04-28 05:49 UTC] laurynas dot butkus at gmail dot com

oh, it's working :) great!
thanks for support.