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

How to solve the problem of file garbled after STS or Eclipse transfers the Pull code from the Git platform to the local

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "how to solve the problem of file garbled code of STS or Eclipse from Pull code of Git platform to local file". In daily operation, it is believed that many people have doubts about how to solve the problem of file garbled code of STS or Eclipse from Pull code of Git platform to local file. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the question of "how to solve the problem of STS or Eclipse from the Pull code of Git platform to the local file garbled"! Next, please follow the editor to study!

First, generate garbled scenarios 1.1, error description

First of all, as shown in the following figure, we use IDE to open the code file from the Git platform Pull to the local code file. I opened the README.md file. Obviously, the file generated Chinese garbled.

1.2, solution ideas

For garbled code generated from Pull on Git platform to local code files, our general check ideas are as follows:

Check the source code on the Git platform. If the file on the Git platform is garbled, then the local code is naturally garbled. You need to re-push the correct non-garbled file from the source local warehouse to the Git platform, and other local computers can download it again from the remote warehouse.

If the code on the Git platform is not garbled (correct), it means that the problem is caused by our local branch.

II. Solution

We are now following the 1.2 solution to conduct the investigation.

2.1. check the source code on the Git platform

First, let's check the source code on the Git platform. As shown in the following figure, there is no garbled code in the Git platform source code file.

Then we can now confirm that the problem is caused by the code Pull to the local computer.

We have now made it clear that the code is from the Git platform, that is, Server Computer Pull to the local, the problem occurs on our local computer Computer A (Computer B). Let's solve this problem now.

2.3.Modification of IDE text encoding format

We click Window → Preferences → General → Workspace in IDE, and slide down to find "Text file encoding".

We can now see that the default text encoding format of IDE is GBK, as shown in the following figure, while the default encoding format of our code on Git platform is utf-8. After we pull the code locally, IDE cannot decode the target code using GBK, which naturally leads to garbled code.

2.4. Resolve the problem of reopening the destination file

Now the encoding format has been modified, but the previous local files are still GBK encoded. So in order to achieve recoding, we need to recompile the file once using IDE.

We close the window of the destination file, double-click to open it again, and we can see that the garbled problem has been solved, as shown in the following figure:

At this point, the study on "how to solve the problem of STS or Eclipse from the Git platform Pull code to the local file garbled" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Development

Wechat

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

12
Report