Signing project destroys East Asian encoding

C

Craig Andrews

Hi All,

I'm having some trouble with embedding English, Simplified Chinese
(CP936) and Japanese (CP932) text in a VBA module in Word 2007. To do
this, I simply have CP1252-encoded CP936 and CP932 characters in string
literals that are converted by the system to the relevant language when
run on a suitable system. This works fine, and means I can use the
relevant strings for the OS the macro is running on.

Unfortunately, when I try to sign the project for distribution, it
appears to destroy Word's ability to interpret the character sets. It
will work on the system on which the certificate was applied, but no
other. For example, if I sign the project on an English machine, the
CP1252 encoded versions of the strings appear on Chinese and Japanese
machines, even though it worked fine just before I signed it.

I have checked the SaveEncoding property of the document, and if I set
it to any of the various Unicode options then it works whileever the
project is unsigned. I usually use CP1200 (utf-16le, I think) but 65001
(UTF-8) seems to work just as well.

So, my question is actually two; first, is there a way to fix this issue
with signing, and second, is this the right way to be handling non-CP1252
string literals? I've tried playing with StrConv and had some success,
but not enough that I could use it reliably within the project. Simply
encoding the CP932 and CP936 strings as CP1252 and copy/pasting them in
seems to work best, up until signing.

Many thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top