cristianbuse / VBA-FileTools

Useful methods for interacting with the file system
MIT License
81 stars 23 forks source link

Fixed bug in GetODFolders #7

Closed guwidoe closed 1 year ago

guwidoe commented 1 year ago

Fixed GetODFolders for folder names containing nasty sequences of Unicode characters that contain "misaligned" Null chars when encoded in UTF-16-LE, e.g. "FolderNameš€€est" would have previously been truncated to "FolderName"

cristianbuse commented 1 year ago

Thanks @guwidoe ,

Just looking at your PR I realized that I was being dumb. There was no need to use InStrB. I just need to use InStr and still search for null char. Just pushed commit b76d7917f72d4f05477147afa3ea1122691aa1cb which solves the issue with minor changes.

guwidoe commented 1 year ago

Fair enough, of course, this works too. I will keep my solution because it generalizes more easily for the macOS version, I just have to define a different search flag for mac, like here.