nikhil1511 opened a new pull request, #1516:
URL: https://github.com/apache/poi/pull/1516

   ### Summary
   
   Keys `ModuleMap` entries in `VBAMacroReader.processDirStream` by 
`StreamNameUnicode` (`pair.unicode()`) when present, falling back to 
`pair.ascii()` only when `pair.unicode()` is empty.
   
   - [MS-OVBA 
2.3.4.2.3.2.3](https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/62cdf46f-c1dc-4b88-aab8-a24c359d13a1)
 specifies that `StreamNameUnicode` MUST contain the UTF-16 encoding of 
`StreamName`.
   - [MS-CFB 
2.6.1](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/60fe8611-66c3-496b-b70d-a504c94c9ace)
 specifies that compound file directory entry names are UTF-16.
   - Both `readModuleFromDocumentStream` (`entry.getName()`) and `getModule` 
(via `PROJECTwm`) already look up modules by their Unicode name.
   
   If convenient, please also consider backporting this fix to the `5.5.x` 
branch.
   
   ### Testing
   
   - Added `TestVBAMacroReader#moduleMapKeyedByStreamNameUnicode` using an 
in-memory `POIFSFileSystem` fixture.
   
   Closes #1512
   
   *Disclosure: Developed with assistance from Google Gemini (`Generated-by: 
Google Gemini`); reviewed and verified by the author.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to