For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
Do you have a URL I could access for testing? I'd like to see the HTTP headers. If the encoding is specified there (in the HTTP headers) then that overrides whatever might be specified in the document.
Sorry about your ISP being down. Hope it comes back up soon and you can get off the backup.
I can't see anything wrong. The problem may be related to the copying and pasting and/or saving the document with the correct encoding.
If you create a new PHP document in CSE HTML Validator, then copy and paste some non-Latin text into it, then go to "File->Save with Encoding" and make sure the encoding is "Unicode (UTF-8)", then click OK, does it work?
If this doesn't help, then can you provide me exact steps that I can use to reproduce the problem? STeps like creating a new document, copying non-Latin text to it, saving it, and loading it from a web browser through a PHP server. I have a web server running PHP that I can use for this test.
It is the "Save with encoding" that fixes the problem. I had not even noticed this option before. Unlike a normal html page, which nowadays I always build to include the meta tag with charset=utf-8, php pages need have no charset specified, even when their internal html code may very well have it. Any utf-8 characters, that may have been pasted would lose the encoding after saving. Only upon reload would the issue become visible. Otherwise, saved files including php, javascript, css, and .txt files use the "system codepage" character set. By contrast, .htm and .html pages including may or may not (html5) save as UTF-8 by default. In fact, the CSE editor will save a blank document as UTF-8 by default!
I guess there is only one question remaining: what does the check box labelled "Use encoding signature" do?
Many thanks for your assistance.
James
I'm glad that fixes the problem. In recent versions I've made some changes to be smarter about saving with the proper encoding and defaulting more to UTF-8. Are you using v16? If not, then it is possible that you wouldn't have encountered this issue (at least I hope not!).
The encoding signature adds some bytes to the beginning of the document to make it easier for programs that support it to use the correct encoding. Here is some more information: https://en.wikipedia.org/wiki/Byte_order_mark
Indeed, my version is getting old, V11, yet trouble free, almost without exception. Quite unlike this power supply of identical age, which died two weeks ago. The BOM is what I suspected. And yet again, I know more than before.
James, I'm glad that v11 has worked so well for you! However, v16 is a lot newer and even better than v11.
I do recommend an upgrade since much has changed (although the interface you know is mostly the same). Also, as of now (January 2016), versions prior to v12 are considered obsolete (which includes v11 and below).
I also hope to release v16.02 at the end of the month. It will be the first 2016 release and free for all customers who are already licensed for v16 (because all minor updates are free).