Skip to content

Unicode and long path support improvements - #10

Merged
0xeb merged 8 commits into
mainfrom
longpath-unicode-v4-squashed
Jan 12, 2026
Merged

Unicode and long path support improvements#10
0xeb merged 8 commits into
mainfrom
longpath-unicode-v4-squashed

Conversation

@0xeb

@0xeb 0xeb commented Jan 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • FileComp plugin: Full Unicode and long path (>260 chars) support
  • F5 Copy: Improved long path target directory creation
  • Code quality: Czech→English comment translations

FileComp Plugin Changes

  • Path storage: char[MAX_PATH]std::string/std::wstring (up to 32767 chars)
  • File operations use CreateFileW for Unicode filenames
  • Added FileExistsW() utility to shared lcutils.h
  • Known limitation: Dialog shows ??? for Unicode (ANSI controls) - file ops work correctly

F5 Copy Improvements

  • SalLPCreateDirectory() for long path support
  • Handle ERROR_ALREADY_EXISTS gracefully (not a failure)
  • Use CPathBuffer instead of fixed MAX_PATH buffers

Comment Translations

Czech→English in: icncache, menu2, salamdr1/3, shiconov, sort, stswnd, tasklist, thumbnl, toolbar4, tooltip

0xeb added 8 commits January 11, 2026 13:56
shellib.cpp:
- Fix AllocChars(wchar_t*) buffer overflow: query required size from
  WideCharToMultiByte before allocating (multi-byte codepages can
  produce more bytes than input characters)
- Add debug logging to destructor to track heap corruption

fileswn4.cpp:
- Add debug output for column configuration and Unicode file info
- Add debug output when extension column code is reached
Translated ~80 comments covering:
- Drag&drop and clipboard operations
- Shell folder and PIDL handling
- Windows XP Remote Desktop compatibility
- NetHood path resolution
- Context menu operations
fileswn9.cpp:
- CopyFocusedNameToClipboard: Use wide path for Unicode filenames
  (Alt+Insert now preserves Chinese/Japanese/Korean characters)

fileswn6.cpp:
- Use GetFileAttributesW/CreateFileW for Unicode source files
  in clipboard paste operations (fixes file not found for ?? paths)

fileswn4.cpp:
- Add debug output for Unicode filename truncation investigation
Part of the CommentsTranslationProject to make the codebase more
accessible to international contributors.
FileComp plugin:
- Use std::string/std::wstring for path storage (up to 32767 chars)
- CreateFileW for opening Unicode-named files
- Wide path parameters throughout plugin classes
- Add FileExistsW utility to shared lcutils.h
- Known limitation: dialog shows '???' for Unicode (ANSI controls)

F5 Copy improvements:
- Fix path existence detection for long paths
- Fix directory creation for long targets

Comment translations:
- Czech→English in 11 core files (icncache, menu2, salamdr1/3,
  shiconov, sort, stswnd, tasklist, thumbnl, toolbar4, tooltip)

Squashed from longpath-unicode-v4 branch.
- Fix potential stack overflow: use heap allocation for ~393KB path buffers
- Fix pre-existing bug: Parent = Parent → Parent = parent (self-assignment)
- Add AnsiToWidePath() helper to reduce code duplication
- Add <memory> include for std::unique_ptr
The vcxproj build (used by CI) was missing the widepath module
that cmake already includes.
@0xeb
0xeb merged commit dbc26a0 into main Jan 12, 2026
6 checks passed
@0xeb
0xeb deleted the longpath-unicode-v4-squashed branch February 15, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant