gpt4 book ai didi

unicode - 从 SQL Server 2008 R2 中检索多语言数据(中文、日文...)并在 Java webapp 中显示

转载 作者:行者123 更新时间:2023-12-04 18:44:17 25 4
gpt4 key购买 nike

我的数据库中有中文数据,我需要在我的 Java 网络应用程序中显示它。但是我得到 ??? 作为输出。

使用的数据库:SQL Server 2008 R2(nvarchar 数据类型用于支持 Unicode 数据,数据库是使用默认排序规则名称创建的,即 SQL_Latin1_General_CP1_CI_AS,没有问题同时将数据存储在 db 中)。

开发环境:Window 7

树状网格用于显示数据。

我已经:

1. set charset and pageEncoding to UTF-8  in my HTML, jsp and Java
pages.

2. Updated my jdbc connection with useUnicode=true;characterEncoding=UTF-8;.

3. Configured Tomcat’s server.xml connector to use UTF-8 (URIEncoding="UTF-8").

我曾将 collat​​ion_name 设置为 Latin1_General_CI_AI,但仍然无法正常工作。

最佳答案

Latin1_General_CI_AI --> 这是你的部分问题。 Latin1 与 Unicode 无关。得到“???”意味着您的工具链中某处存在编码问题,您的 UTF-8 数据被扰乱为另一种编码。

关于unicode - 从 SQL Server 2008 R2 中检索多语言数据(中文、日文...)并在 Java webapp 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12974245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com