Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gradle build source set encoding to UTF-8 #4517

Closed
wants to merge 1 commit into from
Closed

fix: gradle build source set encoding to UTF-8 #4517

wants to merge 1 commit into from

Conversation

DaiYuANg
Copy link

What type of PR is this?

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@f2c-ci-robot f2c-ci-robot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 30, 2023
@CLAassistant
Copy link

CLAassistant commented Aug 30, 2023

CLA assistant check
All committers have signed the CLA.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ruibaby after the PR has been reviewed.
You can assign the PR to them by writing /assign @ruibaby in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DaiYuANg , thanks for your contribution!

建议描述一下当前遇到的问题,或者说明需要手动设置 CompileOption的原因。

@DaiYuANg
Copy link
Author

DaiYuANg commented Aug 30, 2023

Hi @DaiYuANg , thanks for your contribution!

建议描述一下当前遇到的问题,或者说明需要手动设置 CompileOption的原因。

第一次拉取 源代码时 编译 会报GBK编码的错误 环境为Windows 10 Microsoft-jdk-17
image

@guqing
Copy link
Member

guqing commented Aug 30, 2023

Hi @DaiYuANg , thanks for your contribution!
建议描述一下当前遇到的问题,或者说明需要手动设置 CompileOption的原因。

第一次拉取 源代码时 编译 会报GBK编码的错误 环境为Windows 10 Microsoft-jdk-17

或许你应该尝试设置你的 IDE 的 FileEncoding 为 utf-8 而不是 gbk
image

@DaiYuANg
Copy link
Author

Hi @DaiYuANg , thanks for your contribution!
建议描述一下当前遇到的问题,或者说明需要手动设置 CompileOption的原因。

第一次拉取 源代码时 编译 会报GBK编码的错误 环境为Windows 10 Microsoft-jdk-17

或许你应该尝试设置你的 IDE 的 FileEncoding 为 utf-8 而不是 gbk image

个人认为 设置 Compile Option 会更好一点 source code 是 gradle 编译 而不是 IDE

@JohnNiang
Copy link
Member

Hi @DaiYuANg ,如果本地有 Git Bash,可以用它执行一下同样的命令,看看输出是否正常。

@DaiYuANg
Copy link
Author

Hi @DaiYuANg ,如果本地有 Git Bash,可以用它执行一下同样的命令,看看输出是否正常。

输出是正常的 并无 GBK编码 错误
image

@guqing
Copy link
Member

guqing commented Aug 30, 2023

个人认为 设置 Compile Option 会更好一点 source code 是 gradle 编译 而不是 IDE

Compile Option 只会对 Gradle 编译生效,如果 IDE 如下设置呢?,还可以考虑一个问题,如果你在 github 创建一个项目但是你使用了 GBK 编码模打开项目(源文件包含中文)并推送,别人使用 Linux 或 Mac (默认utf-8编码的系统) clone 并打开你的项目,会乱码吗
image

@DaiYuANg DaiYuANg closed this Aug 30, 2023
f2c-ci-robot bot pushed a commit that referenced this pull request Nov 12, 2023
…ject (#4844)

#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

Currently, some Windows developers using GBK as character encoding are unable to build project, please see #4771 for more. 

Because the source code are using UTF-8 character encoding, the `javadoc`, `compileJava`, `compileTestJava` and `delombok` tasks will use the default character encoding GBK to handle the sources, which prevents the `:api:javadoc` task from running properly.

At the same time, we thank to @DaiYuANg for his first proposed solution in #4517.

#### Which issue(s) this PR fixes:

Fixes #4771

#### Special notes for your reviewer:

Validate the result by executing command `./gradlew clean build -x check` on Windows environment.

#### Does this PR introduce a user-facing change?

```release-note
修复在部分 Windows 开发者无法正常构建 Halo 的问题
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants