问题标签 [codepages]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql-server - SQL Server 2005 代码页问题
我有一个我正在尝试解决的问题。我们有一个运行商业 ERP 系统的 SQL Server 2005。这意味着我们无法更改数据库结构,并且所有字符字段都是 CHAR 或 VARCHAR 而不是 Unicode 类型(NCHAR、NVARCHAR)。
我们还拥有多个基于国家/地区的 ERP 软件实例。每个国家/地区在同一数据库服务器上都有自己的数据库,这会导致基于正在运行的 ERP 软件实例的表名有所不同。例如,美国客户表称为 US_CUSTOMER,英国客户表称为 GB_CUSTOMER。我们创建了一个单独的数据库,它基本上用同义词反映了 ERP 系统表,然后是处理我们所有针对这些同义词的 SQL 事务的视图。这样做是为了使用 LINQ TO SQL。感谢您阅读本文:)
我们遇到的问题是我们现在正在为应用程序实施简体中文。在客户 ERP 系统中,他们为 ERP 系统设置代码页,以便 ERP 系统写入基表时,数据以多字节形式写入。我的问题是如何将这些多字节信息翻译回简体中文?我希望能够在数据库级别执行此操作,因为我有需要利用它的 Web 应用程序和 SSRS 报告。
有什么想法或方向吗?我认为我无法更改代码页,因为多个国家/地区正在使用相同的数据库服务器(尽管数据库不同)。
提前谢谢
java - Java 1.6 Windows-1252 编码在 3 个字符上失败
编辑:我一直相信这个问题有点荒谬。感谢那些回复的人。我可能会发布一个更具体的后续问题。
今天我投入了一些编码问题并编写了这个单元测试来隔离一个基本的重现案例:
输出:
Mac OS 10.6.2 上的 JDK 1.6.0_07
我的观察:
Latin1 对称地编码所有 254 个字符。Windows-1252 没有。三个可打印字符(193、205、207)在 Latin1 和 Windows-1252 中是相同的代码,所以我不认为会有任何问题。
谁能解释这种行为?这是JDK错误吗?
- 詹姆士
sql - string incorrectly translated by ado
I have a database with collation SQL_Latin1_General_CP1_CI_AS. In that database I have a varchar field. There is a row in that database with the string "ó" (single character 243 in codepage 1252). I have a simple ASP page that sets the codepage to 65001, reads that row (using adodb), and sends it out to the browser. Everything works fine if the "current language for non-unicode programs" is set to English. If I change that to Russian and browse to the page I see "o". I can set a breakpoint in the server side asp page and it appears that ado is returning "o" instead of "ó".
Why does the "current language for non-unicode programs" matter? The database has the data and is configured for the proper code page. I thought that internally ADO and VBScript stored everything as unicode. It appears that somewhere the string is being converted to the codepage specified in "current language for non-unicode programs" but even that doesn't make much sense as I would expect to see "?" instead of "o" (but I don't really understand what handles the conversion from one codepage to another and what rules it uses).
I understand that changing the column to nvarchar may help but that doesn't explain why this is happening.
(edit) I understand why "ó" is being converted to "o". Windows Best Fit http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1251.txt
Still trying to figure out how to get the codepage 1252 string out of SQL and into VBScript without loss.
visual-c++ - 如何更改 MS Visual Studio 2008 用于打开文件的代码页?
我有一个使用 ibm cp437 的 cpp 文件,Visual C++ 一直使用 windows-1252 读取它。如何让 Visual C++ 为文件使用正确的代码页?
c++ - 如何使用 c++ 或调用 winapi 查找字符是否属于特定代码页
我们如何确定一个字符是否属于特定的代码页?或者我们如何确定一个字符是否适合应用程序的当前活动 IME。
html - ABAP WebAS 活动代码页
我需要连接字符串中的不同行。
为此,我需要使用 CR + LF 十六进制字符。
问题是,当我使用 8 位/字符环境时,我只需要执行以下操作:
但是,当我在 16 位/字符环境中时,X 变量不代表 CR 和 LF 的正确十六进制表示。
所以,我应该使用这样的东西:
那么,有什么方法可以找出 ABAP WebAS 使用的字节/字符的数量?
谢谢!
c++ - 如何从带有 PR_BODY_A 标签的 MAPI 消息中获取编码(windows mobile)?
我正在开发一个程序,通过 windows-mobile MAPI 处理传入的电子邮件和短信。代码基本上是这样的:
那行得通,我有一个消息正文。问题是这个主体是多字节编码的,我需要返回一个 Unicode 字符串。我想,我必须使用 ::MultiByteToWideChar() 函数,但我怎么能猜到,我应该应用什么代码页?使用 CP_UTF8 是幼稚的,因为它可能根本不在 UTF8 中。使用 CP_ACP 有时会起作用,但有时不会。所以,我的问题是:如何检索有关消息代码页的信息。MAPI 是否为它提供任何功能?或者除了MultiByteToWideChar()之外,还有其他方法可以解码多字节字符串吗?
谢谢!
.net - CodePage ID 到 CodePage 名称:Delphi 中的 GetEncoding 等效项?
我正在寻找在 Delphi7 中使用的 .Net Encoding.GetEncoding 方法的 Win32 等效项。
我想要实现的是将代码页 ID(即:28592)转换为代码页名称(在本例中为 iso-8859-2)。
我找到了一个名为 GetCPInfoEx 的 Win32 函数,但它返回一个长的 CodePage 名称,我需要一个短的,就像这个页面上列出的那样:(参见名称列) http://msdn.microsoft.com/en-我们/图书馆/system.text.encoding.aspx
谢谢!
delphi - Delphi 标准输入输出代码页面
德尔福 2010
使用readLn过程从文件读取时,默认情况下,我会从代码页 1251(Windows 的代码页)转换而来的 unicode 字符串。
我怎样才能改变它并从其他代码页中的文件中读取,在 1252 或 UTF16 中?
sql-server-2008 - SQL Server -> 'SQL_Latin1_General_CP1_CI_AS' 排序规则 -> Varchar 列 -> 支持的语言
全部,
我们使用 SQL Server 2008,排序规则设置为“SQL_Latin1_General_CP1_CI_AS”。我们使用 Varchar 列来存储文本数据。我们知道我们不能在 Varchar 列中存储双字节数据,因此如果不将其转换为 NVarchar,就无法支持日语和中文等语言。
但是,可以肯定地说所有单字节字符都可以毫无问题地存储在 Varchar 列中吗?如果是,那么我从哪里可以获得需要单字节存储的语言列表和需要双字节的语言列表?
非常感谢这方面的任何帮助。
提前致谢。