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

Change the JDK default code to solve the problem of DBeaver garbled

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

Share

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

Before, after adding Chinese character notes in DBeaver and selecting Save as, the annotated Chinese characters have garbled problems?

Solution: add the JAVA_TOOL_OPTIONS option to the environment variable and add the parameter-Dfile.encoding=UTF-8-Duser.language=en-Duser.country=US, so that the prompt for JDK is in English, and the Chinese output of the system can be displayed normally, which is suitable for Java/Scala programs. Python also has a similar environment variable PYTHONIOENCODING.

With the changes here, there will be basically no more garbled codes.

The following is why there is garbled problem?

First of all, garbled code is not an insurmountable problem. Don't panic. The garbled problem is caused by different character sets.

More professionally speaking: computer coding (character set). Computer coding is the way computers represent letters and numbers (computers don't know our written language. Only recognize 0 and 1 characters. Here you need to convert the computer code into 0 and 1. In this way, we will not learn the low-level language at the bottom of the computer (such as assembly) in order to use the computer, but only need to be familiar with simple keyboard input, and the computer itself will complete the information from input to output and present the results to us.

Common coding methods are: ASCII coding, GB2312 coding (simplified Chinese), GBK,BIG5 coding (traditional Chinese), ANSI coding, unicode,utf-8 coding, etc.

Let's talk about the origin of all this. The earliest. Computers are only used in those universities in the United States. It is enough for Americans to enter the characters on the keyboard. So ASCII coding was born, and the disk at that time was very small. ASCII encoding takes up only one byte (8 binary bits). Later, Americans wanted the whole world to use computers. However, each country has its own words. You can't use English all over the world. In that case, the threshold of the computer is so high, what should you do if you let people who don't speak English? There will be later computer codes such as GBK,UTF-8. The emergence of them is that computers can include the vast majority of spoken and written languages in the world. It is only today that Chinese people can enter Chinese on computers. Germans can enter German. Koreans can operate computers in Korean. Of course, this is due to the increase in hard disk storage space. These computer codes now occupy 2 bytes (16 binary bits).

Now, tell me why there are garbled codes.

Due to the increase in computer coding (character sets), there is an increase in the number of character sets to choose from. It's all caused. Different software and systems have different default choices for computer coding (character set). This is the source of garbled code.

Because different pronunciations have different effects in different languages. It is also suitable for different characters to produce different effects under different computer codes (character sets).

For example: who does the English word who mean? The Chinese word for hu is window account. There is the abbreviation of Shanghai (Shanghai). This example is clear. The effect of different characters in different character sets.

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