Dave,

Thanks. I saw that, and replied to your other post about it :p

I think Drupal changing the locale without any documentation is sneaky; I expect the locale on my server to be en_US.utf8 because I set it that way.

I shouldn't have to explicitly set me locale every time I want to use a dependent function because Drupal changed it without telling anyone.

Anyways, I am posting an issue in the issue queue about it. We can put any follow up there, so it is 'on the record'.

Brian

Dave Reid wrote:
Brian,

Might want to take a look at http://www.php.net/manual/en/function.iconv.php#86077

Dave Reid
[email protected]

On Mon, Nov 16, 2009 at 9:42 AM, Brian Vuyk <[email protected]> wrote:
Hi all.

I am having a bit of a unique problem here, and I am hoping someone can help me out.

In short, we are outputting strings from a custom module we wrote to an external service that only accepts the ASCII character set. So, I am trying to run all the strings through iconv() to convert them.

Here's the weird part. Take the script below:

$string = "Stéphanie,D Hérouville";
$output = iconv("UTF-8", 'ASCII//TRANSLIT', $string);
print $output;

If I run this from the command line, I get the proper output - 'Stephanie D Herouville'. However, if I run it in my Drupal installation, whether as part of a module or from the Devel 'Execute PHP' box, I get different output: 'St?phanie D H?rouville'. That is, instead of replacing the character with it's expected ASCII counterpart, it replaces it with a ?.

Has anyone encountered this, or have any idea why this is happening?

Brian


Reply via email to