user1009453
user1009453

Reputation: 707

Setlocale is correct but doesn't show Swedish signs

I have this strftime function to display dates:

    <?php 
        echo strftime('
        <div class="vecka">%a</div> 
        <div class="dag">%d</div> 
        <div class="man">%b</div>
        ', 
        strftime($article->eventDate));

                    ?>

I have set setlocale to: setlocale(LC_TIME,"swedish"); And the script does output the Swedish names for the month and day, but without the Swedish signs å, ä, ö which are substituted with a, a, o.

So måndag (monday in English) becomes mandag, lördag (saturday) becomes lordag, and so on...

It looks like's there's some problems with the utf8-encoding, so I tried to wrap it all in utf8_encode but with no result. The script does work on my local machine with xampp. The live server, where the script doesn't work, is debian.

Upvotes: 2

Views: 2131

Answers (1)

Ebpo
Ebpo

Reputation: 804

I answer late, but it might help people who stumble upon this.

Add ".UTF-8" in the language parameter.

Example :

setlocale(LC_TIME, "fr_FR.UTF-8");

Upvotes: 1

Related Questions