W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2015

Re: [whatwg] Unicode -> ASCII copy/paste fallback

From: James M. Greene <james.m.greene@gmail.com>
Date: Fri, 13 Feb 2015 06:18:19 -0600
Message-ID: <CALrbKZj9L5RVPyVAmdgXTLSY6k8C8LZbjYHnFwTUVgw6p_zxdA@mail.gmail.com>
To: David Sheets <kosmo.zb@gmail.com>
Cc: whatwg <whatwg@whatwg.org>
In this case, you can use Unicode escape values by preceding them with a
slash:

  .rarr:after { content: "\2192"; }


This is specified in the CSS 2.1 spec:
http://www.w3.org/TR/CSS2/syndata.html#characters

Personally, I probably would've just started on StackOverflow with this
question (e.g. [1]) but no harm done.


[1]:
http://stackoverflow.com/questions/10393462/placing-unicode-character-in-css-content-value

Sincerely,
    James Greene


On Fri, Feb 13, 2015 at 5:45 AM, David Sheets <kosmo.zb@gmail.com> wrote:

> Hello,
>
> I have a page with
>
> a <span class="rarr"><span>-&gt;</span></span> b
>
> and style
>
> .rarr span { overflow: hidden; height: 0; width: 0; display: inline-block;
> }
> .rarr::after { content: "→"; }
>
> (That's RIGHTWARDS ARROW x2192.)
>
> In Firefox 36, this copies and pastes like "a -> b" which is the
> desired behavior. In Chrome 40, this copies and pastes like "a  b".
>
> Is my desired behavior (to show unicode but copy an ASCII
> representation) generally possible? Are there specs somewhere about
> copy/paste behavior? I looked in <https://html.spec.whatwg.org/> but
> found nothing relevant.
>
> Is this the right venue for this question? Should I take it somewhere else?
>
> Thanks,
>
> David Sheets
>
Received on Friday, 13 February 2015 12:19:06 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:27 UTC