Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Support unicode import/export

Open bclothier opened this issue 5 years ago • 1 comments

Justification VBIDE's import/export assumes current system's code page. It is not Unicode-aware, which means it may export and import files that won't be readable universally. That can be a problem in a git repository for example.

Description We should provide a support for exporting and importing files as Unicode. However, that requires additional actions that the Rubberduck must take before handing off to VBIDE's native API for importing/exporting. In particular, it must perform the re-encoding of the text after export and before import to ensure that it is not gibberish once it's in VBIDE.

It also means that such files would be no longer usable for import in any vanilla VBIDE without Rubberduck. It might be helpful to use explicit BOM if doing so cause the import to fail to prevent VBIDE from trying to import what will be even more gibberish. If having a BOM does not prevent it from importing, then we may need to consider whether we need to block the import by mangling the file in some manner. The downside is that it would then show up in the git repository (or whatever external sources the user may choose to view the source code) and may be confusing.

Another reason to consider the use of explicit BOM is to avoid the need to have a separate menu command to support unicode import/export. Ideally, we want this to be just a setting to set the default behavior but have a single import/export command that can automatically handle both Unicode and non-Unicode files consistently.

bclothier avatar Nov 06 '20 00:11 bclothier

It seems like this is a very low priority and somewhat complicated issue to be solved, but it completely stops me from using the Sync Project feature for source control which is something I always needed in VBA. Some table names in my project have non-ASCII characters and for most of them changing the name is out of the question at this point.

androidWG avatar Dec 26 '21 14:12 androidWG