对“”“”进行编码ISO-8859-1 Oracle 数据库中的字符

发布于 2024-11-04 06:15:38 字数 670 浏览 0 评论 0原文

是否可以在字符集为 ISO-8859-1 的 Oracle 数据库中插入“€”(作为 VARCHAR)?

我想将我的数据库从 ISO-8859-1 字符集移动到 ISO-8859-15 字符集(甚至 WINDOWS-1252 字符集也适合),以便将“€”存储在我的数据库中,但有人告诉我,使用 ISO- 8859-1 数据库字符集,可以直接存储我的“€”字符。

所以问题是,目前我正在尝试为 ISO-8859-1 数据库>找到这个解决方案有一种方法可以插入“€”(取决于客户端/驱动程序/等的字符集,但不取决于数据库的字符集)

您对此有何看法?

如果这是真的,那么为什么我们必须为 Oracle 数据库定义字符集?有人告诉我,这只是为了Oracle“知道需要多少字节来编码字符”(因此选择一个字符集相当于只为Oracle选择一些位来编码每个字符。结论:ISO-8859 -1 = ISO-8859-15-WINDOWS = 1252 在某些方面对于 Oracle 因为所需的位数是相同的......)

我希望我(几乎)很清楚......但是在我看来 我认为我将永远能够在 ISO-8859-1 数据库上执行 INSERT(使用“€”)和 SELECT 并检索我的“€”...

感谢读我的..

(PS:数据库是10g版本)

Is it possible to insert the "€" (as a VARCHAR) in a Oracle Database whose character set is : ISO-8859-1 ?

I want to move from ISO-8859-1 to ISO-8859-15 charset (or even WINDOWS-1252 charset will fit) my database in order to store the "€" in my database, but one told me that with a ISO-8859-1 charset for the database, it WOULD BE possible to store directly my "€" char.

So the problem is that for the moment, I am trying to find this solution for the ISO-8859-1 database > There would be a mean to insert the "€" (depending on charset of the clients/drivers/etc., but not depending on the charset of the database)

What is your point of view about that.. ?

If it is true, then why do we have to define a character set for the Oracle database ? One told me that this is just for Oracle "to know how many bytes are needed to encode the character" (and therefore to choose a charset is equivalent to only choose a number of bits for Oracle to encode each character. conclusion: ISO-8859-1 = ISO-8859-15-WINDOWS = 1252 in some ways for Oracle because the number of needed bits are the same...)

I hope I am (almost) clear.. But in my opinion I think that I will never be able to perform an INSERT (with "€") and SELECT and retrieve my "€" on a ISO-8859-1 database...

Thanks for reading me..

(PS: database is 10g version)

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

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

发布评论

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

评论(1

書生途 2024-11-11 06:15:38

ISO-8859-1 中未分配 字符。因此你无法代表它。与 ISE-8859-15 中相同的字节用于表示¤(货币通用符号)。

来源

Oracle 需要了解什么字符设置它将出于以下目的对数据库进行编码:

  • 了解存储每个字符的字节数
  • 能够在客户端 NLS 不同时执行转换(某些客户端以 UTF-8 发送查询,数据有效) ISO-8859-1:Oracle 可以翻译它)。
  • 分析列内容的包(例如全文搜索)对其字符很敏感。

The character is not assigned in ISO-8859-1. Therefore there is no way you can represent it. The same byte as in ISE-8859-15 is used to represent ¤ (monetary general symbol).

Source

Oracle needs knowing in what character set it will encode the database for the following purposes:

  • Know on how many bytes to store each character
  • Being able to perform conversions when the clients NLS are different (some client is sending a query in UTF-8, with data that is valid ISO-8859-1: Oracle can translate it).
  • Packages that analyze column contents (like full text search) are sensitive to what character it is.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文