Repository navigation
Export test classes as UTF-8 with BOM and detect encoding on import - #94
Merged
Merged
Conversation
VBComponent.Export and VBComponents.Import always use the ANSI code page. The core now rewrites exported .cls/.bas files as UTF-8 with BOM (new setting ImportExportEncoding: Utf8Bom (default) or Ansi) and imports an ANSI copy with CRLF of each source file. The import detects UTF-8 with or without BOM, otherwise ANSI, and rejects all files if one contains characters not available in the ANSI code page.
This was referenced Nov 17, 2026
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
VBComponent.ExportandVBComponents.Importalways use the ANSI code page. The core now converts the files:.cls/.basfiles are rewritten as UTF-8 with BOM and CRLF (like msaccess-vcs). New settingImportExportEncoding(Utf8Bom(default) |Ansi) inTestSuiteUserSettings, the COM interfaceIUserSettings(added at the end) and the VBE add-in property grid. Access documents (SaveAsText) are unchanged.UnsupportedSourceCharactersExceptionlists the files.VbaSourceFileinCommon.VBIDETools(logic taken from the MCP server'sTestModuleSourceFile).UserSettings.SaveunloadsTestSuiteUserSettings.Current, soTestClassManageruses changed settings without restart.Behavior change: exported test classes are UTF-8 with BOM instead of ANSI (noted for the release notes).
Tests
VbaSourceFileTests(TestGeneratorTests, code page 1252): decode, rejection, CRLF, ANSI copy, export conversion.Follow-ups
ImportExportEncoding.VbaSourceFilefrom the core instead of its own conversion logic.