开发者

How to save a character with a line above (like this ō) in a file system?

开发者 https://www.devze.com 2022-12-11 16:29 出处:网络
What file format should I use? It is for PHP to afterwards retrieve su开发者_如何转开发ch a character and for HTML to display.You should be encoding the text as UTF8, then writing it to the file.

What file format should I use? It is for PHP to afterwards retrieve su开发者_如何转开发ch a character and for HTML to display.


You should be encoding the text as UTF8, then writing it to the file.

If you're doing this with PHP, then (I think) it'll be something like:

$f = fopen("/path/to/file", "w");
fwrite($f, utf8_encode($some_string));
fclose($f);

(although, this assumes that PHP is using Unicode internally… But, then, it might not – my memory is kind of hazy)

0

精彩评论

暂无评论...
验证码 换一张
取 消