PDA

View Full Version : Keyboard apostrophe not recognised in HTML



Alwyn
11-19-2013, 02:32 AM
I'm learning the basics of HTML and am finding that the standard Apple keyboard apostrophe gets converted into something like this @. I am using TextEdit formatting in plain text. There is a cumbersome way round the problem by inserting the apostrophe from the special character set.

There seems to be a similar problem with { and } for defining fonts but I haven't found a way round that.

mrplow
11-26-2013, 11:01 AM
What language do you have your Mac set to? Does this match the country it was bought in?

vansmith
11-26-2013, 12:22 PM
I'm learning the basics of HTML and am finding that the standard Apple keyboard apostrophe gets converted into something like this @.I'm guessing that this has something to do with your keyboard layout. I say this because it works fine with a U.S. English keyboard layout, a layout I know is different from the U.K. one.

Upon looking, I notice that there are two U.K. English keyboards. Have you tried the one layout that you aren't using (System Preferences > Keyboard > Input Sources)?


I am using TextEdit formatting in plain text.Oh you brave soul. Look at using an editor designed for coding such as TextMate or Adobe's Edge Code (both free).

mrplow
11-26-2013, 01:59 PM
I'm going to guess you're not using your Apple keyboard or you have US english as the keyboard setting.

On a UK Apple keyboard using British as the keyboard language all those symbols work fine. The apostrophe is on the same key as ". It's next to the \ key next to Enter. Where as @€ are on the number 2 key

Alwyn
12-10-2013, 04:01 PM
Oh you brave soul. Look at using an editor designed for coding such as TextMate or Adobe's Edge Code (both free).

Not brave, ignorant. I am told that, if I want to design a website myself, I should use Dreamweaver or similar but it looks expensive and it also looks as if it may not yet be compatible with Mavericks.

vansmith
12-10-2013, 06:12 PM
Dreamweaver is probably overkill, especially if you're just learning. Those code editors I mentioned are decent starts and may end up suiting your needs just fine. That said, there are many many code editors out there that are both free and more than sufficient for coding.

Alwyn
12-11-2013, 10:46 AM
Dreamweaver is probably overkill, especially if you're just learning. Those code editors I mentioned are decent starts and may end up suiting your needs just fine. That said, there are many many code editors out there that are both free and more than sufficient for coding.

I understand that Snow Leopard had web-creation software called iWeb and that its equivalent is to be found in iCloud.

Is my informant correct? If so where can I find it?

mrplow
12-11-2013, 10:52 AM
It last came as part of iLife 11 and it no longer has a current version, in iCloud or otherwise I'm afraid.

It still works but no saying for how much longer.

Have a look at everweb (http://www.everwebapp.com/)- there's a free trial

Pony Pasture
03-26-2015, 02:53 PM
Could the character sequence you're seeing be "€™"? If so you have a character encoding error. This article, which helped me with a closely related issue, goes into pretty good detail.

https://askleo.com/why_do_i_get_odd_characters_instead_of_quotes_in_m y_documents/

[eta] Short version: Try turning off smart quotes when writing code rather than natural-language prose or verse. If you want typographic quotation marks (and use the right single quotation mark as an apostrophe), set your document's character encoding to Unicode for the broadest compatibility and remember not to use curly quotes in HTML code, only in displayable text.

Hope this helps!

[edit] Arrrgh, I didn't notice how old this post was. Guess the problem has been resolved one way or another by now. Sorry to bump such an old thread.

DrQuincy
11-12-2015, 11:05 AM
Are you saying it shows as @€ once you view it in the browser? If so, this is your solution.

I'd guess you're using latin-1/ISO 8859-1. latin-1/ISO 8859-1 only support 256 characters because it's one byte per character ((8 *2) * (8 *2)).

There are two solutions:

1. Instead use the newer UTF-8 character set which can use between 1 and 4 bytes to store a character. UTF-8 can store a whopping 1,111,998 characters. If you set your web page to use a character set like latin-1/ISO 8859-1 when it comes across a character that is represented by more than one byte it mis-renders it into something like @€. To convert to UTF-8 you should be able to set the character encoding in your text editor (set it without BOM as this will only cause you problems) but you also need to set the character set in your web page (instead of what you have there already):


<meta charset="utf-8" />

2. Keep the encoding as is but use HTML entities. For example curly quotes (“”) aren't usually part of a single byte encoding but you can instead express then in HTML as &ldquo; and &rdquo;

I do not recommend option two. For everything, always, always, always use UTF-8. You will save yourself headaches in the future.

Note UTF-16 and UTF-32 may sound better than UTF-8 but neither can store characters as a single byte so aren't as efficient.

Always, always, always use UTF-8 for your text documents, database connections, etc.

If @€ appears within the text editor changing the character encoding should still solve your problem.

chscag
11-12-2015, 08:23 PM
Note that the original post was from November 2013.