我有一个数据编码问题。我的数据库在其中一列中有口音,在api中返回一个PDO查询SQL SERVER中的列。只要我返回,我通过json_encode方法转换成JSON,再加上JSON就是NULL。当我给var_dump带有重音符号的问号时,这个字符会出现' ',而json是空的。 我知道这是我需要转换为UTF8的编码,但我无法在php中进行此转换。谁能帮我?返回JSON NULL
0
A
回答
-2
相关问题
- 1. Json返回'null'
- 2. 大Json返回null
- 3. ajax JSON返回null
- 4. 返回null的JSON
- 5. Json :: decode返回NULL
- 6. Json数组返回null
- 7. php JSON对象返回null
- 8. ajax php json返回null
- 9. GSON JSON解析返回null
- 10. 的Json解码返回NULL
- 11. Json to php,json_decode返回NULL
- 12. JSON返回null数据
- 13. json解析返回null
- 14. JSON序列返回NULL
- 15. JSON结果返回null
- 16. Stripe API JSON返回null
- 17. 返回NULL的JSON元素
- 18. JSON PHP数据返回null
- 19. Json数据返回null
- 20. JSON解析返回null
- 21. Android JSON解析返回null
- 22. 为什么WCF/JSON不为null返回值返回`null`?
- 23. JSON对象返回null(android + json + php + mysql)
- 24. null == null返回false?
- 25. AJAX/json返回null打开购物车
- 26. JSON解析与GSON返回null对象
- 27. Android JSON请求,输入流返回null
- 28. Datatables - Json输出 - PostgreSQL - 返回null
- 29. Json Tag与gson一起返回null
- 30. 解析JSON字符串返回null
帮助吗? http://stackoverflow.com/questions/16800915/php-pdo-charset-utf8-an-invalid-keyword-charset-was-specified-in-the-dsn-str –
尝试'utf_encode()'并检查。你能否也请告诉那里的原始人物是什么? –
<?php ini_set('display_errors',1); ini_set('display_startup_errors',1); include_once'../../../config.php'; include_once'../../../config.php'; include_once'../api/helpdesk.php'; include_once'../api/conexaoSql.php'; require_login(); $ codigo = $ _GET ['id']; 尝试{ $ objHelp = new helpdesk(); $ mensagens = $ objHelp-> SelecionaMensagem($ codigo); // var_dump($ mensagens); echo json_encode($ mensagens,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); ($ e-> getMessage());}};}};}}; } –