Вопрос по php – PHP японское эхо-строка становится вопросительными знаками

7

Error: User Rate Limit Exceeded

echo.php:

<?php
function draw(){
echo "日本語";
}
draw();
?>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<?php
 some stuff
 include "echo.php";
 draw();
?>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<html lang="ja">
<head>  
<title>Running Projects</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<div id="header">
<? php include "layout.php" ?>
</div>
</body>
</html>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded deceze♦

Ваш Ответ

7   ответов
0

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
&,lt;meta http-equiv="Content-Language" content="ja" />
0

$connectionInfo = array("Database"=>"db name", "UID"=>"username", "PWD"=>"pw","CharacterSet" => "UTF-8");
$serverName = "server";
$conn = sqlsrv_connect($serverName, $connectionInfo);

<meta charset="utf-8" />

header('content-type: text/html; charset=utf-8');
7

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta charset="utf-8" /> 

header('content-type: text/html; charset=utf-8');
Error: User Rate Limit Exceeded Asitaka
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededutf8_encode convertsError: User Rate Limit Exceededutf8_encodeError: User Rate Limit Exceeded
2

<?php
function draw(){
echo mb_convert_encoding("日本語", 'UTF-8', array('EUC-JP', 'SHIFT-JIS', 'AUTO'));
}
draw();
?>

3

All your strings in all PHP scripts are Unicode (UTF-8 is a very common choice). Use utf8_encode() and/or utf8_decode() to force UTF-8 on your strings where necessary. Your server sends PHP output as Unicode (UTF-8 and preferably, but not necessarily, gzipped data) Your browser understands and accepts Unicode (UTF-8). Typically browser would send Accept-Charset: UTF-8,*;q=0.5 in the GET request to hint it's Unicode capability.

GETAccept-Charset: UTF-8,*;q=0.5

echo "&#x00A9;";©htmlentities()htmlspecialchars()

0

mysqli_set_charset("utf8");

Error: User Rate Limit Exceeded Asitaka
1

That happens when charset is not defined or is incorrect.

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta charset="utf-8" />

Похожие вопросы