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 #329, split with ascii character. #331

Merged
merged 1 commit into from Oct 17, 2021
Merged

fix #329, split with ascii character. #331

merged 1 commit into from Oct 17, 2021

Conversation

sayurin
Copy link
Member

@sayurin sayurin commented Oct 17, 2021

改行コード CR LF や マルチバイト漢字がバッファ境界で分断されないように、ascii文字+LFで分割する。これにより、改行コードや漢字の文字化けを回避する。

@sayurin sayurin self-assigned this Oct 17, 2021
@sayurin sayurin merged commit 3b77817 into master Oct 17, 2021
@sayurin sayurin deleted the fix-329 branch October 17, 2021 01:27
@sayurin
Copy link
Member Author

sayurin commented Oct 17, 2021

#230 も一定改善される。

@YasuoKITAJIMA
Copy link

 ご対応、ありがとうございます。確認のための質問があります。
 「ascii文字+LFで分割する」とのことっですが、文書ファイルの様な全てマルチバイト漢字からなるファイルは問題ないでしょうか。(分割しないで処理する、ということでしょうか。)
 以上、よろしくお願いします。

@sayurin
Copy link
Member Author

sayurin commented Oct 18, 2021

改行 CR LF もしくは LF が含まれていれば、その中の LF を使用して分割します。また、Shift-JISコードの場合、マルチバイトではありますが、約5割の確率で2バイト目はASCIIコードになるため、そこでも分割します。
UTF-8コードで、いわゆる半角文字が一切含まれず、また空白や改行も一切含まれない場合は、分割できないため従来通りの適当なブロックサイズで強制的に分割され、文字化けすることになります。

@sayurin sayurin added this to the v5.5 milestone Nov 14, 2021
hwtnb pushed a commit to HaijinW/ffftp that referenced this pull request Oct 31, 2022
fix ffftp#329, split with ascii character.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants