Javascript Json_编码umlauts输出

Javascript Json_编码umlauts输出,javascript,php,json,wordpress,jsonp,Javascript,Php,Json,Wordpress,Jsonp,我想用德语umlauts显示我的输出,我的输出是这样的,例如Fu009 \但我需要这样的“fü” <?php $json = (object) array( "salutation" = > ''.$order - > order_custom_fields['_billing_anrede'][0]. '', "title" = > ''.$order - > order_custom_fields['_billing_titel'][0]

我想用德语umlauts显示我的输出,我的输出是这样的,例如Fu009 \但我需要这样的“fü”

<?php
$json = (object) array(
    "salutation" = > ''.$order - > order_custom_fields['_billing_anrede'][0].
    '',
    "title" = > ''.$order - > order_custom_fields['_billing_titel'][0].
    '',
    "first_name" = > ''.$order - > order_custom_fields['_billing_first_name'][0].
    '',
    "last_name" = > ''.$order - > order_custom_fields['_billing_last_name'][0].
    '',
    "street" = > ''.$order - > order_custom_fields['_billing_address_1'][0].
    '',
    "street_number" = > ''.$order - > order_custom_fields['_billing_address_2'][0].
    '',
    "address_supplement" = > ''.$order - > order_custom_fields['_billing_company'][0].
    '',
    "zipcode" = > ''.$order - > order_custom_fields['_billing_postcode'][0].
    '',
    "city" = > ''.$order - > order_custom_fields['_billing_city'][0].
    '',
    "country" = > ''.$pais.
    '',
    "terms_accepted" = > true,
    "receiving_mails_accepted" = > ''.$email.
    '',
    "email" = > ''.$order - > order_custom_fields['_billing_email'][0].
    '',
    "lottery_accepted" = > false,
    "lottery_solution" = > "LOTTERY",
    "original_created_at" = > ''.date('Y-m-d\TH:i:sP', strtotime($order - > order_date)).
    '',


);

foreach($items as $item) {
    $sku = $wpdb - > get_var($wpdb - > prepare('SELECT meta_value FROM dsr_postmeta WHERE meta_key="_sku" AND post_id='.$item['product_id'].
        ''));
    $sku_s = explode('-', $sku);
    $camp = $sku_s[0];
    $itm_n = $sku_s[1];
    $json - > items[] = (object) array(
        "campaign_number" = > (int) $camp,
        "item_number" = > (int) $itm_n,

    );
}



array_push($json_full, $json);
echo json_encode($json_full);
?>

如果您使用的是PHP5.4+,请更改
echo json_encode($json_full)
to
echo json\u encode($json\u full,json\u UNESCAPED\u UNICODE)

json\u encode
预定义常量的完整列表可在此处找到:

集会示威 代码:


如果您使用的是PHP5.4+,请更改
echo json_encode($json_full)
to
echo json\u encode($json\u full,json\u UNESCAPED\u UNICODE)

json\u encode
预定义常量的完整列表可在此处找到:

集会示威 代码:


您的字符集设置正确吗

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

您是否正确设置了字符集

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


您已经有了答案。只是使用HTML实体,但如何使用?像这样?你已经有答案了。只是使用HTML实体,但如何使用?像这样?你肯定错过了什么。我用示例更新了我的答案。你的示例对我也不起作用,在第二次输出中,我得到了uml:null,我不知道问题出在哪里。请提供准确的PHP版本。这是一个答案+1你肯定遗漏了什么。我用示例更新了我的答案。你的示例对我也不起作用,在第二次输出中,我得到了uml:null,我不知道问题出在哪里。请提供准确的PHP版本。这是一个+1的答案
<head><meta charset="utf-8"></head>