Discussion:
[css-d] non-English characters: omit accents when using text-transform:uppercase
sweepslate
13 years ago
Permalink
I want to text-transform:uppercase a piece of text writen in Greek. The
Greek language requires that:

a. in lower case text, some letters need to have accents --and
b. in full upper case text, LIKE THIS, have no accents at all

My problem is: if I use the uppercase property I will end up with upper
case accented text, which is a typographical error.

I could write the text, inside the HTML, in lower case and omit the
accents - but that would make it a typographical error when viewed
without CSS.

I could write the text using upper case characters, inside the HTML, and
omit the accents - but using upper case in this webpage is a decision of
style, not content, so I'd rather do it with CSS.

Any ideas?
Philip TAYLOR
13 years ago
Permalink
Post by sweepslate
I want to text-transform:uppercase a piece of text writen in Greek. The
a. in lower case text, some letters need to have accents --and
b. in full upper case text, LIKE THIS, have no accents at all
[...]
Post by sweepslate
I could write the text using upper case characters, inside the HTML, and
omit the accents - but using upper case in this webpage is a decision of
style, not content, so I'd rather do it with CSS.
Off-hand, no, but could you clarify : are you speaking of polytonic
("classical") Greek or modern (monotonic) Greek ?

Philip Taylor
Philip TAYLOR
13 years ago
Permalink
Post by Philip TAYLOR
Off-hand, no, but could you clarify : are you speaking of polytonic
("classical") Greek or modern (monotonic) Greek ?
Incidentally, Mozilla claim to do it properly :

https://developer.mozilla.org/en/CSS/text-transform
...
Philip Taylor
sweepslate
13 years ago
Permalink
Beeing able to have the user agent figure that out would be a great
solution.

I checked on Firefox 14, and it didn't work. Check yourself if you'd like:

http://geocities.ws/sweepslate/greek-accenting/greek-accenting.html
Philip TAYLOR
13 years ago
Permalink
Post by sweepslate
Beeing able to have the user agent figure that out would be a great
solution.
http://geocities.ws/sweepslate/greek-accenting/greek-accenting.html
Oh dear. Also true in Seamonkey 2.11. Well, Mozilla clearly know
what /should/ happen : I wonder why it does not ?

Philip Taylor
Philippe Wittenbergh
13 years ago
Permalink
Beeing able to have the user agent figure that out would be a great solution.
http://geocities.ws/sweepslate/greek-accenting/greek-accenting.html
Yes, the property is context (language) sensitive. But you have to specify the language in use. Your test file specifies that the language used is english (e.g. through the lang attribute on the html element [1]).

Gecko does it indeed correctly (I think), once the language is specified (lang='el' for greek). Unfortunately, WebKit and Opera fail (tested OS X Lion).

http://dev.l-c-n.com/_temp/up-gr.html

[1] you could also specify it on a specific element, like <div lang='fr'> in case you have a poly-lingual document

Philippe
--
Philippe Wittenbergh
http://l-c-n.com/
sweepslate
13 years ago
Permalink
I tried your example, and the upper case letters still have accents.

I tried adding lang="el" myself, on <html> and on <p>, but the accents
are still there:

http://geocities.ws/sweepslate/greek-accenting/lang_el1.html
http://geocities.ws/sweepslate/greek-accenting/lang_el2.html
Philippe Wittenbergh
13 years ago
Permalink
Post by sweepslate
I tried your example, and the upper case letters still have accents.
Hmm.
It works for me.
Oh, but I have a nightly Firefox build, not the release build (which version is the latest ?). After a quick look though the MDC docs, it appears you'll have to wait for Firefox 15 to have it work correctly.


Philippe
--
Philippe Wittenbergh
http://l-c-n.com/
sweepslate
13 years ago
Permalink
Post by Philippe Wittenbergh
Hmm.
It works for me.
Oh, but I have a nightly Firefox build, not the release build (which
version is the latest ?). After a quick look though the MDC docs, it
appears
Post by Philippe Wittenbergh
you'll have to wait for Firefox 15 to have it work correctly.
Yes, it works with on the latest Firefox Nightly.

Is this something we'll see in CSS3 or just a Mozilla thing?
Philippe Wittenbergh
13 years ago
Permalink
Post by sweepslate
Is this something we'll see in CSS3 or just a Mozilla thing?
CSS 2.1 ?
[quote]
The actual transformation in each case is written language dependent
[/quote]

http://www.w3.org/TR/CSS21/text.html#propdef-text-transform

(who wrote that sentence… so hard to read)

CSS 3 text is a little more verbose
http://dev.w3.org/csswg/css3-text/#transforming

Other browsers will have to update their implementation at one point.


Philippe
--
Philippe Wittenbergh
http://l-c-n.com/
sweepslate
13 years ago
Permalink
Yes.

Thank you, Philippe, Robert, and Philip :)
sweepslate
13 years ago
Permalink
Post by Philip TAYLOR
Off-hand, no, but could you clarify : are you speaking of polytonic
("classical") Greek or modern (monotonic) Greek ?
Modern, monotonic Greek.

Beeing able to do this in classical, polytonic Greek would be a great
bonus though!
Robert A. Rosenberg
13 years ago
Permalink
At 14:11 +0300 on 07/22/2012, sweepslate wrote about [css-d]
...
How many blocks of Greek text is this needed for? Are the accented
letters a different Unicode codepoint from the same letter unaccented
or is it unaccented letter followed by the accent? If so, you can
just use find/replace to do the conversion of the text in the HTML.

One way that this may work is if you can duplicate the text in both
lower and upper case and then just use span with class tags to mark
each version. Use style=hide to not display the version you want.

I may be misunderstanding your needs so this advice might not be what need.
sweepslate
13 years ago
Permalink
Post by Robert A. Rosenberg
How many blocks of Greek text is this needed for? Are the accented
letters a different Unicode codepoint from the same letter unaccented or
is it unaccented letter followed by the accent? If so, you can just use
find/replace to do the conversion of the text in the HTML.

I'm not sure I understand.

All text is UTF-8. The HTML file is UTF-8 encoded and the <meta> charset
is set to utf-8.

Is this what you mean?
Post by Robert A. Rosenberg
One way that this may work is if you can duplicate the text in both
lower and upper case and then just use span with class tags to mark each
version. Use style=hide to not display the version you want.

You mean display:none?
Alan Gresley
13 years ago
Permalink
...
Philippe gave some suggestions. FYI, this is also a bug in the spec.

http://lists.w3.org/Archives/Public/www-style/2011May/0602.html

http://lists.w3.org/Archives/Public/www-style/2012Jan/0868.html
--
Alan Gresley
http://css-3d.org/
http://css-class.com/
mijalis
12 years ago
Permalink
This uppercase is *not* working when the full language code is specified, eg:
lang='el-GR' (tested in firefox 23)
Example: http://www.ispania.gr/tests.html
I think that it should be working for any combination of the first two chars
matching the correct lang code...




--
View this message in context: http://css.2040035.n2.nabble.com/non-English-characters-omit-accents-when-using-text-transform-uppercase-tp7580157p7581645.html
Sent from the css-discuss mailing list archive at Nabble.com.
L. David Baron
12 years ago
Permalink
Post by mijalis
lang='el-GR' (tested in firefox 23)
Example: http://www.ispania.gr/tests.html
I think that it should be working for any combination of the first two chars
matching the correct lang code...
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=905381 on this
problem. Thanks for pointing it out.

-David
--
𝄞 L. David Baron http://dbaron.org/ 𝄂
𝄢 Mozilla https://www.mozilla.org/ 𝄂
Before I built a wall I'd ask to know
What I was walling in or walling out,
And to whom I was like to give offense.
- Robert Frost, Mending Wall (1914)
Continue reading on narkive:
Search results for '[css-d] non-English characters: omit accents when using text-transform:uppercase' (Questions and Answers)
379
replies
What is a 'jejemon' and why the sudden popularity?
started 15 years ago
words & wordplay
Loading...