dongyi8795 2008-11-13 03:07
浏览 147

如何强制PHP使用UTF-8字符集[重复]

I'm not sure if my question's title is clear enough but I'll try my best to explain.

I really am not sure about how PHP executes the function mysql_query in terms of retrieval and storage of strings. Does it recognize any character set encodings used in the table?

And does my browser by default override any character encodings sent through <forms>, meaning if I put 'ëä' in any <input> or <textarea> will these characters be sent as they are?

Next, how would PHP handle these characters? Can I force PHP to write these characters as they are into the database?

Knowing how I made my database tables, and their corresponding collations, how could I force PHP to return the correct string values that were in the database?

Hehe sorry for being too lazy to google, but I ran through this problem before in another table and thought I found a solution but I was thinking that maybe I just ticked my broswer's options to use by default a UTF-8 encoding?

Okay so in this case then the user's browser really has power over what type of character encoding they would use to render a page... are there any workarounds?

See:

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作