Em dash location

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Em dash location

Post by mo »

Hello, simple (I hope) question: In a document I am editing there appears what I used to call an "M" dash. I would like to use this character instead of the usual --. Does anyone know the code for this character (Using Courier New (but I see it appears in the edit box here also:
" — "
Best Wishes!
Mike Olds
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

There are quite a few ways:
1) Hold down Alt, then press 0151 on the Number Pad (somewhat tricky on laptop keyboards)
2) Start, Run charmap and copy and paste the symbol...
3) Use the ASCII chars clip library and click on the symbol to insert...

Hope that helps
User avatar
ramonsky
Posts: 88
Joined: Fri Nov 14, 2003 10:54 am

Post by ramonsky »

I tried this, and it didn't work for me.

151 is decimal for 0x97. Windows by default uses its own character encodings, which, not-surprisingly, are completely non-standard and don't interoperate with anything else. On my machine the Windows code page is "code page 1252". In this system, EM DASH has the character code 151 decimal, = 0x97. Therefore, CyberSlug's solution may or may work for you - but ONLY if you're running Windows (which I guess you are, since you're using TextPad), if you happen to live in the locale for which Micro$oft decree code page 1252 to be the norm, you haven't changed the system defaults, and you haven't changed TextPad's defaults. And even then - don't expect to be able to share your document with anyone else. The rest of the world may not have the same set-up as you, and may see a different character at codepoint 0x97.

Here's the real problem: EM DASH is a Unicode character. Its true, Unicode, codepoint is U+2014. TextPad does not support Unicode, so I'm not sure there is any universal way of doing it at present. If you petition TextPad to support Unicode by voting for it in the Enhancements forum, maybe that can happen in the future.

Jill

PS.
CyberSlug wrote:Use the ASCII chars clip library and...
Trivial point, but if a clip library named "ASCII chars" contains EM DASH then this clip library is seriously mis-named. ASCII defines the range 0x00 to 0x7F, and no more. There is no EM DASH in ASCII. It should more properly be called the "Windows code page 1252 clip library".
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

Thanks both for your answers.

Using the TextPad ANSI Characters Clip Library: ¯X_ is as close as you get.

I did set up a clip in my "scraps" and "html" clip libraries for this before getting these answers.

"Alt+0151" does give me X—X which is what I was asking, so thank you.

So then the question for me is using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

is everyone going to be able to see this? It slips by my html validator ok. Partial answers: Mozilla: it comes out as a double M-dash, which is ok. In Opera: I get the black-diamond-? which is not really ok. Back to --.

Thanks again,
Best Wishes!
Mike Olds
User avatar
ramonsky
Posts: 88
Joined: Fri Nov 14, 2003 10:54 am

Post by ramonsky »

mo wrote:<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


Change this to:
I wrote:<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252">
and you'll be fine. This is important - if you don't change this, conformant applications around the world will render your em-dash as a black blob or some other "unsupported character" glyph. (Windows is highly non-conformant, by the way, so it might work on Windows machines even if you don't change it).
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

If you want this for an HTML document (as I guess from the doctype stuff), use

&mdash; or &#8212;
User avatar
ramonsky
Posts: 88
Joined: Fri Nov 14, 2003 10:54 am

Post by ramonsky »

MudGuard wrote:&8212;
MudGuard's suggestion is indeed a good one, but it shouldn't be needed if you change the charset declaration. In other words - use MudGuard's suggestion OR mine - either will work, but you don't need both at once (although both at once would be harmless).

Incidently, it would probably be more readable to use hex instead of decimal, since Unicode codepoints are usually expressed that way. So, instead of "&#8212", you could use "&#x2014;", which is nearer to U+2014 (which is how you normally discover Unicode codepoints in tables and stuff). MudGuard's alternative suggestion of using "&mdash;" should work in browsers supporting HTML 4.0 or above, but "&#x2014" and "&#8212" will work on older browsers too. Changing the charset should work everywhere.

For a full list of code page 1252 equivalents, try this chart. Below the table, the first column is the Windows codepoint, and the second column is the corresponding Unicode codepoint. You'll see that code page 1252 is identical to Unicode everywhere except 0x80 to 0x9F inclusive. You can use the chart to find equivalents other than just EM DASH. (Warning - the chart is supplied by Microsoft, and hence makes the erroneous and stupid claim to be "Latin 1". This claim should be completely disregarded. Code page 1252 is not Latin 1).

Jill
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

I have made the experience that hex unicodes are not as well supported in browsers as decimal ones...
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

Again thanks both. The M dash suggested is really larger than an Em and does not look good to my eye, especially as my style is to leave space around on both sides, so I am just going to stick with the --.

Also for reasons I have forgotten that have to do with scar tissue left from battles over on the WC3 board which caused me to first switch FROM 1252 I am just going to let that be.
Best Wishes!
Mike Olds
Post Reply