As a test, I paste the following text in a .php file on the server: 颜色分类
I then save, the file.
I close, and re-open the file, and then the text appears as : 颜色分类
I then save the file again, without modifying the content, and re-open it again
The text then appears as: 颜色分类
My headers are: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
I checked my database is also on utf8_general_ci
However, could this really be those settings? The file is individually saved on the FTP without any server or database requests or anything. Could this soley be due to the editor that is being used to save/upload the file? I use CoffeeCUP FTP.
It's highly likely that the editor is causing this. Have you tried saving it in an editor like Notepad++ (making sure the file is being saved with UTF-8 encoding) and uploading the file?
Related
Reaching out to see if any ADA compliance experts might know how I might resolve an ADA compliance issue pertaining to our video transactions. We essentially provide links to .txt files for all of our videos which contain the video transcription. But when running an ADA scan we receive 2 errors pertaining to our transcriptions.
"Language missing or invalid "
"Missing or uninformative page title"
I'm not sure how I would tell a screen reader or ADA scanner the language or a page title given that these are just plain txt files. Any assistance would be greatly appreciated. Thanks.
This might be more about how your browser is set up to handle .txt files. Is your default action to download the file or to view it in the browser?
If the file is downloaded, then it's up to the end user to display the .txt file in whatever program they have set up to view them.
If you're letting the browser display the page, then that page is generated by the browser and I'm not sure if you can customize the page that's generated. I tried Firefox, Chrome, and Edge and they all generated a similar template to view a text file. (Edge uses the chromium engine so it's not surprising that Edge and Chrome have the same template). There's just a minor difference in the <head> between Firefox and Chrome.
This is essentially what's generated:
<html>
<head>
<!-- if using firefox -->
<link rel="stylesheet" href="resource://content-accessible/plaintext.css">
<!-- if using chrome/edge -->
<meta name="color-scheme" content="light dark">
</head>
<body>
<pre>
(contents of text file)
</pre>
</body>
</html>
If you run an accessibility scanner on this generated page, you will indeed get the two errors you mentioned.
3.1.1 Language of Page
2.4.2 Page Titled
For the language, that's specified on the <html> element with the lang attribute. If you bring up the code inspector on this stackoverflow page, you'll see lang="en":
<html class="html__responsive " lang="en">
For the page title, that's specified in the <head> with a child element of <title>. You can also see that in the stackoverflow page:
<head>
<title>wcag - ADA Compliance Language Missing or Invalid for video transcription txt files - Stack Overflow</title>
...
</head>
If no page title is specified, the browser usually shows the URL or just the filename as the title.
So, can you do anything about the template? I'm not sure. That would be an interesting project.
An alternative is to have your own webpage display the text file, which you would obviously have complete control over and could specify the language and the page title. But I would make this a lower priority issue over other accessibility issues that your website might have.
I have a problem with the charset of my files.
I create the documents in localhost by setting the charset to UFT8 (wb), but when uploading to the online server the charset is changed to ANSI.
I use Filezilla and the provider is Kinghost.
Update: I switched to binary transfer. Apparently it did not work. See the configuration in the image below. In the second image, the encoding in notepad.
Filezilla's transfer mode must be binary so that the file does not have its edited charset.
But my problem was having created the files in ANSI. When creating the files we must choose UTF-8 without BOM.
I am using translation files for translating my xpages application to turkish language.
I have set the application encoding to UTF-8 (xsp.html.page.encoding=utf-8)
Most of my languages is working fine but there is problem with Turkish and Polish
The problem I have is that the labels from the translation file do not display the correct encoding even though I have it set up correctly.
All content that is created on my site display correctly in turkish but not the labels from the translation files.
I have tried setting lang=tr, lang=tr-TR, added UTF-8 meta tags, and changed the property file encoding to UTF-8 but still it is not working,
Here is an example
This is Correct turkish entered into the translation file
FACEBOOK KİŞİLİĞİNİZ İLE GİRİŞ YAPIN
This is a sample what the browser outputs
FACEBOOK KÝÞÝLÝÐÝNÝZ ÝLE GÝRÝÞ YAPIN
This is my header settings
<html lang="tr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
You can also see a live example of this problem at http://www.intrapages.com
at the bottom of the login screen there is change language link, set it to turkish
This is a unicode issue. Designer does not convert those characters to unicode.
You can export '.properties' file, use native2ascii command line utility to convert it to unicode values (\uXXXX format).
Another easy option is using an online native2ascii converter. There are a couple of those I know (e.g. this and this)
We're working with a Classic ASP project in VS 2012. We imported the files from an old repository to a new project.
The issue is that we need to save the file as UTF-8. Some of them already are encoded in UTF-8, but others are encoded in Windows-1252. So googling a bit, we found out about the "Advanced Save Options" menu. We can change the file to UTF-8, but when we make changes to the file and save it (deleting one char, for example), VS then switches automatically to the previous enconding (Windows-1252, or ISO-8859-1, codepage 28591).
Is there a way to make VS to always save the files in UTF-8? Or are we mistaken from the beginning and should take another approach?
PS: We have already set the option "Save as Unicode when data cannot be saved as codepage"
PS2: This happens too in VS 2013 preview
Many thanks in advance
Ok, I found the solution:
I started to paste code from an old file in UTF-8 to an empty one, which was in Windows-1252 and then I changed to UTF-8.
When I pasted the part of the head, there was a
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
and VS then switched to ISO-8859-1, codepage 28591. It seems that VS 2012 / 2013 recognizes the meta tag and what charset you have chosen, and changes the file's encoding, which I find to be logical, but it could be useful to tell the user why you're switching encodings :)
I have an issue of showing Chinese characters, look at these 2 pages.
http://www.wufangsingapore.com/instructor-junbeng.php
http://www.wufangsingapore.com/schedule.php
You will realised that the first link which I linked didn't have any issues with the Chinese characters while my second one is showing as ??? despite the fact that it is showing fine in cPanel. Both pages' charset in the meta tag are set to "charset=utf-8" which is supposed to be right. What could be the issue?
Both of them are just pure html, even though they are in PHP extension, they are not reading from any database.
Thanks!
WHile I didn't figure out what really happened.
This is what i did to make the chinese characters appear.
Open up the file in cPanel's File Manager and copy the whole chunk of PHP/HTML code onto the notepad
Save the notepad file as the file name again schedule.php
Reupload via Windows Explorer FTP.