在 iOS 中重新创建类似 Siri 的弯引号

发布于 12-23 02:06 字数 80 浏览 3 评论 0原文

我不确定他们是否使用图像或是否是某种文本转换,但苹果如何实现 Siri 响应中的卷曲引号样式?当我尝试用常规引号重新创建它时,我得到的是常规引号。

I'm not sure if they use an image or if it's some kind of text transformation, but how does apple achieve the curly quote style found in Siri responses? When I attempt to recreate it with regular quotes I get just that, regular quotes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沦落红尘2024-12-30 02:06:47

看起来他们正在使用 UNICODE“左双引号”和“右双引号”标记 - 代码点 U+201C (“) 和 U+201D (”)。您可以将它们直接嵌入到源代码中(有关如何输入它们的信息,请参阅 wikipedia)。

bash$ cat foo.m
#include <Foundation/Foundation.h>
int
main() {
    NSLog(@"“%@”\n", @"Hello");
    return 0;
}
bash$ gcc foo.m -framework Foundation
bash$ ./a.out
“Hello”

您也可以使用十六进制转义将它们嵌入为 UTF-8 序列:

    NSLog(@"\xE2\x80\x9C%@\xE2\x80\x9D\n", @"Hello");

It looks like they are using the UNICODE "Left Double Quotation" and "Right Double Quotation" marks -- code point U+201C (“) and U+201D (”). You can embed them directly into your source (see wikipedia for how to type them).

bash$ cat foo.m
#include <Foundation/Foundation.h>
int
main() {
    NSLog(@"“%@”\n", @"Hello");
    return 0;
}
bash$ gcc foo.m -framework Foundation
bash$ ./a.out
“Hello”

You can embed them as UTF-8 sequences using hex escapes as well:

    NSLog(@"\xE2\x80\x9C%@\xE2\x80\x9D\n", @"Hello");
星光不落少年眉2024-12-30 02:06:47

它们被称为“智能引号”或“书籍引号”,这是与常规引号不同的 Unicode 代码点。智能引号的 unicode 代码点是“左双引号”的 U+201C 和“右双引号”的 U+201D。将其与“U+0022”进行比较,后者是“引号”。

They are called "smart quotes" or "book quotes", which is a different Unicode code point than regular quotes. The unicode code point for smart quotes are U+201C for the "Left double quotation mark" and U+201D for the "Right double quotation mark". Compare that to U+0022 which is "Quotation mark".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文