Norwegian letters in PHP

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Eksekiel
Forum Newbie
Posts: 1
Joined: Sat Nov 20, 2010 5:55 am

Norwegian letters in PHP

Post by Eksekiel »

Through Dreamweaver CS5 I'm following a tutorial of PHP.

But when I'm using 'echo' line and write a sentence with norwegian letter and then save it to my local testing PHP-server I just get some funny letters instead of my norwegian letters.

If I use norwegian letters inside a html-file and saves it to another local testing serveron my PC, the testing server has no problem showing these norwegian lettes, so I assume that this is a problem inside the local PHP-server

How can I change this so it can show the norwegian letters properly on my local PHP-server on my PC?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Norwegian letters in PHP

Post by Weirdan »

you need to specify correct encoding either via configuration, http header or meta tag in html
beetree
Forum Commoner
Posts: 26
Joined: Mon Jul 18, 2011 6:30 pm
Location: Peninsula

Re: Norwegian letters in PHP

Post by beetree »

I'm Swedish and whenever I code I input swedish letters immediately into my editor without any special ascii coding. I think you have an issue with encoding. Use UTF8 _everywhere_ (including in your editor) and I think you should be fine.

/beetree
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Norwegian letters in PHP

Post by Apollo »

Eksekiel wrote:How can I change this so it can show the norwegian letters properly on my local PHP-server on my PC?
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets

Essential quote from article: It does not make sense to have a string without knowing what encoding it uses. You can no longer stick your head in the sand and pretend that "plain" text is ASCII. There Ain't No Such Thing As Plain Text.
Post Reply