当我使用 csv 文件导入古吉拉特语数据时,时间数据显示如下? [英] When I importing gujarati data using csv file that time data show like?

查看:17
本文介绍了当我使用 csv 文件导入古吉拉特语数据时,时间数据显示如下?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 db2 数据库,当我导入古吉拉特语数据时,时间数据会显示一些符号.我尝试设置 UTF-8 但它仍然是显示符号.db2-server 平台是windows.如何导入古吉拉特语数据?

I am using db2 database and when I importing gujarati data that time data show some symbols. I try to set UTF-8 but still it's show symbol. Db2-server platform is windows. How to importing gujarati data.?

推荐答案

从问题描述中并不清楚是客户端问题还是数据库问题,所以我将展示解决此类问题的通用步骤.我了解您的意图是将数据存储为 UTF-8 和 Db2 文档说:

It is not clear from the problem description whether there is an issue with the client or the database, so I will show universal steps to troubleshoot an issue of this kind. I understand that your intention is to store the data as UTF-8 and Db2 documentation says:

Unicode 支持以下印度文字:印地语、古吉拉特语、卡纳达语、孔卡尼语、马拉地语、旁遮普语、梵语、泰米尔语和泰卢固语.

The following Indic scripts are supported through Unicode: Hindi, Gujarati, Kannada, Konkani, Marat Punjabi, Sanskrit, Tamil and Telugu.

即我们可以为古吉拉特语使用任何 UTF-8 数据库(代码页 1252).根据维基百科分配了 91 个代码点,从 U+0A81 到 U+0AD0.这意味着在内部 它们将需要 3 个字节用于编码为 UTF-8 的存储(这也意味着第一个字节将始终为 0xE).

i.e. we can use any UTF-8 database (code page 1252) for Gujarati. It has 91 code points assigned according to Wikipedia, from U+0A81 to U+0AD0. This implies internally they will need 3 bytes for storage encoded as UTF-8 (which also means first byte will be always 0xE).

让我们尝试以ગુજરાતી"(古吉拉特语)为例.它由 7 个字符组成:

Let's try to use "ગુજરાતી" (Gujarati) as an example. It consists of 7 characters:

U+0A97 GUJARATI LETTER GA       utf-8 0xE0AA97
U+0AC1 GUJARATI VOWEL SIGN U    utf-8 0xE0AB81
U+0A9C GUJARATI LETTER JA       utf-8 0xE0AA9C
U+0AB0 GUJARATI LETTER RA       utf-8 0xE0AAB0
U+0ABE GUJARATI VOWEL SIGN AA   utf-8 0xE0AABE
U+0AA4 GUJARATI LETTER TA       utf-8 0xE0AAA4
U+0AC0 GUJARATI VOWEL SIGN II   utf-8 0xE0AB80

让我们测试一下:

db2 "create table gujarati_tab(c1 int, c2 varchar(10 codeunits32))"
db2 "insert into gujarati_tab values(1, 'ગુજરાતી')"

为了确保数据正确存储,我们可以检查列的二进制结构:

To make sure data is stored properly we can examine the binary structure of our column:

db2 "select hex(c2) from gujarati_tab"

1                                          
-------------------------------------------
E0AA97E0AB81E0AA9CE0AAB0E0AABEE0AAA4E0AB80 

现在您可以将其拆分为 7 个 3 字节结构,每个结构都匹配给定字符的预期字节集:

Now you can split that into 7 3-byte structures each matching expected set of bytes for given characters:

E0AA97 E0AB81 E0AA9C E0AAB0 E0AABE E0AAA4 E0AB80

这意味着数据已正确存储在数据库中.如果客户端仍然存在问题,则严格来说是客户端应用程序没有解释数据库返回的正确 UFT-8 数据的问题.

which implies data is stored correctly in the database. If there is still an issue on the client end, it will be strictly a problem of client application that is not interpreting correct UFT-8 data returned by the database.

这篇关于当我使用 csv 文件导入古吉拉特语数据时,时间数据显示如下?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆