L\ 字符表示法?

发布于 2024-07-29 20:57:46 字数 318 浏览 2 评论 0原文

我通过 ODBC 连接从 SQL Server 2005 获取字符串,其中包含以“L\”开头的字符,后跟字符代码。 这些字符无法在 Ruby/Rails 中显示,但可以在使用相同 ODBC 连接的其他应用程序中显示。 我正在使用带有 utf-8 的 ruby​​-odbc gem。 元音变音字符可以正确显示,但以“L\”开头的字符则无法正确显示。 例如,'L\264' 表示重音符,'L\262' 是 '³','L\263 是 '²'。

我的问题:

  • 它们属于哪个字符集?
  • 它们如何显示在
    红宝石/导轨?

I get strings over an ODBC connection from a SQL Server 2005 which contain characters beginning with 'L\' followed by the character code.
These characters are not displayable in Ruby/Rails but with other Applications which are using the same ODBC connection. I am using the ruby-odbc gem with utf-8. Umlaut characters are displayed correctly, but not these starting with 'L\'.
Examples are 'L\264' for acent grave, 'L\262' is '³' and, 'L\263 is '²'.

My questions:

  • To which character set do they belong?
  • How can they be displayed in
    Ruby/Rails?

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

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

发布评论

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

评论(2

陪你搞怪i 2024-08-05 20:57:48

数据库使用 Latin1,因此它可能是拉丁语,但上标 3 在拉丁语/8859-1 中是 179,而不是 263。
我将用可转换字符集中的等效字符替换 iconv 无法转换的字符。 这已经足够了,因为数据中当前只有三个字符。

The database uses Latin1 so it it probably Latin but superscript three is 179 in Latin/8859-1 and not 263.
I am substituting the characters which can not be converted by iconv with equivalent characters from a convertible character set. This is sufficient because there a currently only three of these characters in the data.

并安 2024-08-05 20:57:46

看起来您有一些自定义的 Unicode 编码。 “L”可能代表从左到右或拉丁语。 这些数字似乎是 Unicode 或 Ansi 字符编号的八进制表示形式。 诡异的。

这几乎肯定与 SQL Server 无关。 我猜测可能是 ODBC 工件。

Looks like you've got some custom Unicode encoding. The "L" probably stands for either Left-to-Right or Latin. The numbers appear to be the Octal representation of the Unicode or Ansi character number. Weird.

This almost certainly has nothing to do with SQL Server. Probably an ODBC artifact woould be my guess.

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