Jump to content
Sign in to follow this  
firewzy

UNICODE Compile Script Problem

Recommended Posts

firewzy

Hello, I meet a problem of processing Chinese characters in UNICODE compiled AUTOIT script.

In ANSI mode a Chinese character such as "中" is identified to be 2 characters, but in UNICODE mode to be 1 character.

My problem is that how to identify a Chinese character "中" in UNICODE mode to be 2 character.

#AutoIt3Wrapper_UseAnsi=y
msgbox(0, "test", stringlen("中国人")) ;output 6oÝ÷ Ù«­¢+ØÕѽ%ÐÍ]ÉÁÁÉ}U͹ͤõ¸)µÍ½à À°ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÍÑÉ¥¹±¸ ÅÕ½ÐìÈÀÀÄÌìÈÈÈØäìÈÀÄÔÐìÅÕ½Ð줤í½ÕÑÁÕÐÌ

I have tried my best to solve it, but no answer.

Share this post


Link to post
Share on other sites
Siao

Sorry, but it's the other way around - the output you get in ANSI mode is wrong. StringLen is meant to return the number of characters, not bytes. And that's total of 3 characters.


"be smart, drink your wine"

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
Sign in to follow this  

×