Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PL/SQL DEV utf8 garbled problem utf8 bom

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Character set information:

Database character set: al32utf8

Local client character set: utf8

Plsqldev default file encoding: utf8 has no bom-set by itself and automatically identified by default

Question:

Export some table data to sql file through plsqldev. After opening it through plsqldev, Chinese garbled code is found.

Analysis:

First of all, use notepad++ to open the sql file, no random code, looked at the file character coding, is utf8 no bom.

Then check the database character set and the local oracle client character set settings, both of which are utf8.

It is suspected that it is the plsqldev tool character encoding recognition problem, convert the file to utf8 containing bom, and then open it with plsqldev, no garbled code.

But at present, utf8 including bom format is prone to problems in unix and linux environment, so the scheme of changing file coding is abandoned.

Accidentally found that another sql file which is also utf8 without bom is opened with plsqldev without garbled code. By comparison, it is found that the first sql sentence of the latter contains Chinese, while the former contains Chinese after 50 items.

Is it possible that the plsqldev tool identifies whether the utf8 contains bom according to the location that appears in Chinese?

Under the test, put the Chinese sql statement in the first sql file to the first, open it with plsqdev, and sure enough, there is no garbled!

So, sql statements containing Chinese can only be put on the first line in order to be free of garbled code?

Under verification, put the sql with Chinese on the third line without garbled code; on line 10 with no garbled code; and on line 20 with garbled code.

Is there an easier way? Emmm, try to add a Chinese comment to the first line of the sql file, the result is ok, no garbled code.

Speculate:

Plsqldev opens the utf8 file and determines whether the file contains bom by the location that appears in Chinese, that is, if the first n lines or the first n characters do not appear in Chinese, the file is considered as utf8 containing bom.

Solution:

Add a Chinese comment to the first line of the utf8 file without bom format.

Open:

At present, I have not verified whether it is the previous n-line or the previous n-character as the judgment condition, just to speculate.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report