English 中文(简体)
How to save a character with a line above (like this ō) in a file system?
原标题:
  • 时间:2009-11-18 22:05:47
  •  标签:
  • format

What file format should I use? It is for PHP to afterwards retrieve such 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)





相关问题
Custom Formating a DateTimePicker using CultureInfo

I am using the DateTimePicker control in a Vb.Net Windows project. I would like the date to reflect the Regional Settings on the user s computer, but also to show the month name, rather than the ...

What settings storage format to choose?

I m writing a Qt application and will need to store the settings for the program. I want them to be easily editable by non-advanced users yet be flexible enough for advanced users (thus allow easy ...

Parsing date with timezone from an email?

I am trying to retrieve date from an email. At first it s easy: message = email.parser.Parser().parse(file) date = message[ Date ] print date and I receive: Mon, 16 Nov 2009 13:32:02 +0100 But I ...

Arduino String Formatting Issue

I m making an Arduino-powered clock, and in the process, I m trying to format integers into two-digit formatted strings for the time read-out (e.g. 1 into "01"). The following gives me "error: ...

How to get fields from such a string?

I m importing some data from a database. The data has been stored by a CMS written in php where I have no control. Here is the data (a dense report from a paypal response): a:56:{ s:8:"business";s:19:...

Nginx raises 404 when using format => js

I upload images to my App using Ajax and an Iframe. In Development everything works like a charm. But in production Nginx suddenly raises a 404 error. When I look into the log, the request never hits ...

Check if string is of SortableDateTimePattern format

Is there any way I can easily check if a string conforms to the SortableDateTimePattern ("s"), or do I need to write a regular expression? I ve got a form where users can input a copyright date (as a ...

热门标签