我可以使用 iconv 将多字节智能引号转换为扩展 ASCII 智能引号吗?
我有一些包含多字节智能引号字符的 UTF-8 内容。我发现此代码可以轻松地将这些字符转换为 ASCII 直引号(ASCII 代码 34):
$content = iconv("UTF-8", "ASCII//TRANSLIT", $content);
OR
$content = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $content);
但是,我宁愿将这些字符转换为扩展 ASCII 智能引号(Latin 1 编码中的 ASCII 代码 147 和 148)。有谁知道该怎么做?
I have some UTF-8 content that includes multi-byte smart quote characters. I've found that this code will easily convert those characters to ASCII straight quotes (ASCII code 34):
$content = iconv("UTF-8", "ASCII//TRANSLIT", $content);
OR
$content = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $content);
However, I'd rather convert these to extended ASCII smart quotes (ASCII codes 147 and 148 in Latin 1 encoding). Does anyone know how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找 CP-1252,其中包含位于 0x91-0x94 处的“弯引号”( 145-148)。
You're looking for CP-1252 which contains "curly quotes" at 0x91-0x94 (145-148).