Skip to main content

How do I obtain language-sensitive inner and outer quotation marks?

2 replies [Last post]
viravan
Offline
Joined: 2003-06-23

According to w3c HTML 4.0.2 spec:

Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.

User agents should render quotation marks in a language-sensitive manner (see the lang attribute). Many languages adopt different quotation styles for outer and inner (nested) quotations, which should be respected by user-agents.

The following example illustrates nested quotations with the Q element.

John said, I saw Lucy at lunch, she told me
Mary wants you
to get some ice cream on your way home. I think I will get
some at Ben and Jerry's, on Gloucester Road.

Since the language of both quotations is American English, user agents should render them appropriately, for example with single quote marks around the inner quotation and double quote marks around the outer quotation:

John said, "I saw Lucy at lunch, she told me 'Mary wants you
to get some ice cream on your way home.' I think I will get some
at Ben and Jerry's, on Gloucester Road."

Question: Does java provide a way to obtain language-sensitive inner and outer quotation marks?

I am currently using unicode 201C and 201D to render outer quotes and 2018 and 2019 for inner quotes as shown in the picture at the link shown below:

http://home.comcast.net/~viravan/p1.png

I can change my parser to accept user-specified character like so:

........

but if there is a way to obtain the language-specific characters, it would be great!

;o)

V.V.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
zpm
Offline
Joined: 2003-06-16

> Question: Does java provide a way to obtain language-sensitive inner and outer quotation marks?

None that i'm aware of; however you may want to ask this question on the Java2D forum. java.text and java.awt.font are considered parts of 2D and they implement some Unicode algorithms.

viravan
Offline
Joined: 2003-06-23

Thanks again...

FWIW....,I have basically identified all characters that are suitable for use as inner/out quote marks (see link shown below), opted for a US-EN defaults of ""'' and provided a [b]CHARS[/b] attribute to override the default.

;o)

V.V.

http://home.comcast.net/~viravan/misc/aokML_QuoteChars.htm