0

I'm using various European characters (like ø, ą, ñ) in my database, but they are not correctly displayed in my php-file. I've tried some things (below) that I found in simmilar questions, but none of them works.

<head>
  <meta charset="utf-ISO-8859-1">
  ...
</head>


<head>
  <meta charset="utf-8">
  ...
</head>


<?php
header('Content-Type: text/html; charset=ISO-8859-1');
echo "øąñ";
?>

1 Answer 1

1

It is correct displayed with <meta charset="utf-8">. If you are trying to get these characters from database, maybe you have not mysql set_charset function used.

$mysqli = new mysqli('localhost', 'user', 'password', 'database');
$mysqli->set_charset('utf8');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.