Unicode and long path support improvements - #10
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileComp Plugin Changes
char[MAX_PATH]→std::string/std::wstring(up to 32767 chars)CreateFileWfor Unicode filenamesFileExistsW()utility to sharedlcutils.h???for Unicode (ANSI controls) - file ops work correctlyF5 Copy Improvements
SalLPCreateDirectory()for long path supportERROR_ALREADY_EXISTSgracefully (not a failure)CPathBufferinstead of fixedMAX_PATHbuffersComment Translations
Czech→English in: icncache, menu2, salamdr1/3, shiconov, sort, stswnd, tasklist, thumbnl, toolbar4, tooltip