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

patchのエンコーディングのバグを修正 #753

Merged
merged 13 commits into from
Sep 7, 2020

Conversation

ty-v1
Copy link
Contributor

@ty-v1 ty-v1 commented Jun 22, 2020

resolve #389
resolve #565

  • テストを追加
  • 保存時はUTF-8に変換する

変更点

ソースコードはすべてUTF-8に変換してから保持する.

ファイルへの出力は実行環境に関わらずUTF-8
コンソールへの出力時のエンコーディングは実行環境に依存する.
つまり,windowsであればwindows31-j(shift jis),max・linuxであればUTF-8に変換してから出力する.

@ty-v1 ty-v1 changed the title [WIP] diffにエンコーディングの違いwo [WIP] patchのエンコーディングwo Jun 22, 2020
@ty-v1 ty-v1 changed the title [WIP] patchのエンコーディングwo [WIP] patchのエンコーディングのバグを修正 Jun 22, 2020
@ty-v1 ty-v1 closed this Jul 28, 2020
@ty-v1 ty-v1 reopened this Jul 28, 2020
@ty-v1 ty-v1 changed the title [WIP] patchのエンコーディングのバグを修正 patchのエンコーディングのバグを修正 Aug 21, 2020
@ty-v1 ty-v1 requested a review from tt-kuma August 21, 2020 10:43
@ty-v1
Copy link
Contributor Author

ty-v1 commented Aug 21, 2020

手元でも文字化けしていないか確認お願いします

Copy link
Contributor

@tt-kuma tt-kuma left a comment

Choose a reason for hiding this comment

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

windowsのコマンドプロンプトで実行したところ,文字化け直ってなさそうです.
ログへの出力,パッチファイル共に文字化けします.
java起動時に-Dfile.encoding=UTF-8 のオプションを付ければ文字化けしません.

--- example.CloseToZero
+++ example.CloseToZero
@@ -3,20 +3,19 @@
 public class CloseToZero {
 
   /**
-   * 整数をゼロに一つ近づけるメソッド
+   * 謨エ謨ー繧偵ぞ繝ュ縺ォ荳�縺、霑代▼縺代k繝。繧ス繝�繝�
    * 
-   * bug: 0を与えたときに0であるべきが1になる
+   * bug: 0繧剃ク弱∴縺溘→縺阪↓0縺ァ縺ゅk縺ケ縺阪′1縺ォ縺ェ繧�
    * 
-   * fix1: バグ行を削除<br>
-   * fix2: バグ行の次に 'n--;' を追加<br>
-   * fix3: バグ行を 'return n;' で置換
+   * fix1: 繝舌げ陦後r蜑企勁<br>
+   * fix2: 繝舌げ陦後�ョ谺。縺ォ 'n--;' 繧定ソス蜉�<br>
+   * fix3: 繝舌げ陦後r 'return n;' 縺ァ鄂ョ謠�
    * 
    * @param n
    * @return
    */
   public int close_to_zero(int n) {
     if (n == 0) {
-      n++; // bug here
     } else if (n > 0) {
       n--;
     } else {

@ty-v1
Copy link
Contributor Author

ty-v1 commented Sep 1, 2020

何かおかしいと思ったら,pushし忘れていました.
修正もしたので確認お願いします.

Copy link
Contributor

@tt-kuma tt-kuma left a comment

Choose a reason for hiding this comment

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

windows環境でも文字化けしないので問題ないと思います.
フォーマットだけお願いします.

src/main/java/jp/kusumotolab/kgenprog/CharsetDetector.java Outdated Show resolved Hide resolved
@ty-v1
Copy link
Contributor Author

ty-v1 commented Sep 3, 2020

修正しました.
確認お願いします.

Copy link
Contributor

@tt-kuma tt-kuma left a comment

Choose a reason for hiding this comment

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

良いと思います.
マージします.
お疲れ様でした.

@tt-kuma tt-kuma merged commit 199d910 into master Sep 7, 2020
@tt-kuma tt-kuma deleted the fix-patch-encoding branch September 7, 2020 05:30
@ty-v1 ty-v1 restored the fix-patch-encoding branch October 8, 2020 10:48
@shinsuke-mat shinsuke-mat deleted the fix-patch-encoding branch March 17, 2021 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants