2005 Aug 09 3:02 AM
hi,
there's a string ,it contains characters , some is unicode and another isn't .
how can i judge it ?
2005 Aug 09 3:18 AM
Hi Mei,
I don't think it is possible. Either it is Unicode or No-Unicode, you can not have a mixed string. Can you elaborate more on your problem ?
Cheers,
Sanjeev
2005 Aug 09 4:02 AM
To me ,the question is shown below,
I have a string , it's too loog to fit the width, then
I have to show it in many rows,I use an fixed length ,for example 10 .To the unicode character, the amount is 5. but if there's a common character ,e.g. A, in the string,an unicode character will be truncated, so I can't show the string correctly, Then I need to distinct the characters.
2005 Aug 09 3:51 AM
Hi, you can try to convert the string to xstring or binary format. Then compare every character as a Hex value.
I remember there are some characteristics in the Unicode , which combine two byte as a char, and the first of the byte should has a rule on it. But I can't remember clearly the details of the rule.
It's a suggestion, you should do further research on the protocol of Unicode.
Hope it will be helpful.
Message was edited by: zhenglin gu
2005 Aug 09 4:21 AM
Hi, I understand your problem, and have met the same prolbem.
You should check every char from the tail of the string, compare if a byte is bigger than 7F(maybe this value, you can find some material on network), if so, it means this is the first byte of a DBCS(Double-Byte Character Set), if not, you should check next byte before it, if still not, the this one is a single char, if the front one is more than 7F, than this is the second byte of a DBCS.
According to this logic, then you can calculate out if the position you want to split is belong to a DBCS or not, then you can choose the proper action to split it.
Hope it will be helpful.
By the way, I achieve it by this logic, but don't know if there is any exists standard FM can do this.
Thanks
Message was edited by: zhenglin gu
2006 Dec 26 7:10 AM