What is the code for "smart quotes" - "Curly quotes"? Chr(34) gives straight quotes

Hello,

What is the code for “smart quotes” - “Curly quotes”? Chr(34) gives straight quotes.

Thanks.

Lennox

Not sure if this is what you want but the following will give you the left and right curly double quotation marks according to the Character Viewer in OS X.

leftCurly = Encodings.UTF8.chr(&U201C) rightCurly = Encodings.UTF8.chr(&U201D)

leftCurly = &U201C
rightCurly = &U201D

&U is a Unicode char literal

Norman, are you saying I can simply assign &U201C etc. to a string without all the Encodings.UTF8.chr(&U201C) goodies. If so it sure saves a lot of typing.

Yes
&Uxxxx IS a UTF-8 Unicode char literal, much like typing “c”, just specified using the code point

Well, I’ll be danged. I have a couple programs that can have a fair amount of statement shortening. I am glad that you posted what you did. Guess I should have figured that out on my own but now and then you need some enlightening from another.

Thanks Harry and Norman.
Lennox

I don’t get it. Why the hassle to look for the Unicode code points at all?
What’s wrong with

[code]
const leftCurlyUS = ““”
const rightCurlyUS = “””

const leftCurlyGerman =“„”
const rightCurlyGerman = ““”[/code]
This is less typing, less searching for code points and self explaining…

[quote=66793:@Thomas Eckert]I don’t get it. Why the hassle to look for the Unicode code points at all?
What’s wrong with

[code]
const leftCurlyUS = ““”
const rightCurlyUS = “””

const leftCurlyGerman =“„”
const rightCurlyGerman = ““”[/code]
This is less typing, less searching for code points and self explaining…[/quote]

For some weird reason the original post has been deleted so I don’t know what the question actually was, but when I saw the original subject I assume it referred to what they quotes actually are. As in “let me know so I can use the correct ones”.

Using the proper unicode points might be overkill in this specific example (especially when using a built-in IDE that’s fully Unicode Compliant, you can even use Emoji, or you could at some point in the past), but the answer has been useful as a more general pointer on how to use arbitrary Unicode characters you may not know beforehand or you may not want to set constants for.

So, probably bad example but good note on Unicode use.

[quote=66793:@Thomas Eckert]I don’t get it. Why the hassle to look for the Unicode code points at all?
[/quote]
Typing those in isn’t always easy so if you look the character up online it might be jus as simple to just use the code point

Except for keyboard layouts that do not generate curly quotes. I was not aware of &u and learned something potentially very useful. Thank you Norman :slight_smile:

On OS X it’s pretty simple to get the right glyph
The Character Viewer makes it a point & click operation

Ah… I see. I seems so that I’m corrupted by using a Mac… :wink:
Still I agree that the “&u” is very useful.

[quote=66632:@Norman Palardy]Norman Palardy

leftCurly = &U201C
rightCurly = &U201D

&U is a Unicode char literal[/quote]

Didn’t know this was possible. Good tip!