Jump to content
Macro Express Forums
Wordhewer

Append Variable To File — Results In Chinese!

Recommended Posts

When I use the command to append a text variable to a text file, the result appears in Chinese glyphs, not the Roman (English) characters in the variable.

This happens no matter which text editor I use to view the output.

I don't use Chinese as an optional language on my system, and I can't think of any configuration of mine that would cause this result. I'm not Chinese, my system is not configured for Chinese, and I don't understand why this conversion takes place.

I'd appreciate help from anyone familiar with this problem.

Thanks!

// Steve In Toronto //

 

Share this post


Link to post
Share on other sites

So show us the content of the text variable being appended, and the command(s) used to do the appending.  And attach a screen shot of the text editor screen showing the result. 

Share this post


Link to post
Share on other sites

Never mind.  I thought you were doing a late April Fool's joke, but mine does the same thing.  Using ME version 3.9.0.1.  With Notepad I loaded "abcdefgABCDEFG" into a file, then ran these two macro instructions.  Results below.  I don't know if it's Chinese or Martian characters, but there it is.

Variable Set String %T1% "abcdefgABCDEFG"
Variable Modify String: Append %T1% to Text File

abcdefgABCDEFG扡摣晥䅧䍂䕄䝆਍

Share this post


Link to post
Share on other sites

Hmmmmm.  Things are looking clearer now.

Notepad saved the original file as Unicode, but ME adds ANSI (non-unicode) characters.  If you then open the file with Notepad specifying Unicode encoding it looks funny (Chinese).  If you specify ANSI when opening it, not quite so funny; the original data has two bytes per character (Unicode), and the appended data looks fine, only one byte per character. 

ÿþa b c d e f g A B C D E F G abcdefgABCDEFG

If you run the macro with the file not existing at all, then it is created as ANSI and the appended data is ANSI and everything looks fine. 

abcdefgABCDEFG

If you create the file from scratch with Notepad and specify ANSI when you save it, then run the macro, everything looks fine.

Variable Set String %T1% "abcdefgABCDEFG"
Variable Modify String: Append %T1% to Text File

abcdefgABCDEFGabcdefgABCDEFG

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×