Fix: Windows에서 한글 파일명 분리 현상 해결

FTP RFC 2640 표준에 따라 파일명을 NFC 형식으로 전송하도록 변경.
- 기존 NFD 변환 코드 제거 (convertFileListToNFD, denormalizeFilename 호출)
- Windows 클라이언트: NFC로 받아 한글이 정상 표시
- Mac 클라이언트: NFC를 자동으로 NFD 변환하여 처리
- 파일 검색 시 NFD/NFC 양방향 호환성은 findFileWithNormalization()으로 유지

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-02 05:02:06 +09:00
parent 3357fe76d4
commit 0c3b7054bd

View File

@@ -182,8 +182,6 @@ public class FTPSession implements Runnable {
return; return;
} }
String path = fileSystem.getCurrentPath(); String path = fileSystem.getCurrentPath();
// Convert path to NFD format for MacOS compatibility
path = denormalizeFilename(path);
sendResponse(FTPResponse.PATHNAME_CREATED, "\"" + path + "\" is current directory"); sendResponse(FTPResponse.PATHNAME_CREATED, "\"" + path + "\" is current directory");
} }
@@ -203,8 +201,6 @@ public class FTPSession implements Runnable {
if (fileSystem.changeDirectory(path)) { if (fileSystem.changeDirectory(path)) {
String currentPath = fileSystem.getCurrentPath(); String currentPath = fileSystem.getCurrentPath();
// Convert path to NFD format for MacOS compatibility
currentPath = denormalizeFilename(currentPath);
sendResponse(FTPResponse.REQUESTED_FILE_ACTION_OK, "Directory changed to " + currentPath); sendResponse(FTPResponse.REQUESTED_FILE_ACTION_OK, "Directory changed to " + currentPath);
} else { } else {
sendResponse(FTPResponse.FILE_UNAVAILABLE, "Failed to change directory"); sendResponse(FTPResponse.FILE_UNAVAILABLE, "Failed to change directory");
@@ -219,8 +215,6 @@ public class FTPSession implements Runnable {
if (fileSystem.changeToParentDirectory()) { if (fileSystem.changeToParentDirectory()) {
String currentPath = fileSystem.getCurrentPath(); String currentPath = fileSystem.getCurrentPath();
// Convert path to NFD format for MacOS compatibility
currentPath = denormalizeFilename(currentPath);
sendResponse(FTPResponse.REQUESTED_FILE_ACTION_OK, "Directory changed to " + currentPath); sendResponse(FTPResponse.REQUESTED_FILE_ACTION_OK, "Directory changed to " + currentPath);
} else { } else {
sendResponse(FTPResponse.FILE_UNAVAILABLE, "Already at root directory"); sendResponse(FTPResponse.FILE_UNAVAILABLE, "Already at root directory");
@@ -239,8 +233,6 @@ public class FTPSession implements Runnable {
} }
String fileList = fileSystem.formatFileList(true); String fileList = fileSystem.formatFileList(true);
// Convert filenames to NFD format for MacOS compatibility
fileList = convertFileListToNFD(fileList);
sendResponse(FTPResponse.FILE_STATUS_OK, "Opening data connection for directory list"); sendResponse(FTPResponse.FILE_STATUS_OK, "Opening data connection for directory list");
@@ -272,8 +264,6 @@ public class FTPSession implements Runnable {
} }
String fileList = fileSystem.formatFileList(false); String fileList = fileSystem.formatFileList(false);
// Convert filenames to NFD format for MacOS compatibility
fileList = convertFileListToNFD(fileList);
sendResponse(FTPResponse.FILE_STATUS_OK, "Opening data connection for name list"); sendResponse(FTPResponse.FILE_STATUS_OK, "Opening data connection for name list");
@@ -309,8 +299,6 @@ public class FTPSession implements Runnable {
if (fileSystem.makeDirectory(dirName)) { if (fileSystem.makeDirectory(dirName)) {
String newPath = fileSystem.getCurrentPath() + "/" + dirName; String newPath = fileSystem.getCurrentPath() + "/" + dirName;
// Convert path to NFD format for MacOS compatibility (NFC -> NFD for display)
newPath = denormalizeFilename(newPath);
sendResponse(FTPResponse.PATHNAME_CREATED, "\"" + newPath + "\" directory created"); sendResponse(FTPResponse.PATHNAME_CREATED, "\"" + newPath + "\" directory created");
} else { } else {
sendResponse(FTPResponse.FILE_UNAVAILABLE, "Failed to create directory"); sendResponse(FTPResponse.FILE_UNAVAILABLE, "Failed to create directory");