RE: How to identify two byte characters in an MFC program?
- From: Sachintha <Sachintha@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Aug 2008 19:26:04 -0700
Thanks guys for all the suggestions.
I tried both above, and there are two major problems with them.
Trim() doesn't seem to identify the double byte whitespace while
SpanExcluding() doesn't return the characters after the first occurence of
the character we're looking for. So, if my string has a character after a
leading whitspace, it still goes inside the if block.
Anywayz, I got around the problem with something a little similary to what
you guys have suggested.
I replaced the double byte whitespaces with single byte whitespaces and then
checked for single byte whitespaces, and if threre are only spaces, I output
an error.
Here:s the code:
[code]
//文字列には2バイトのスペースがある場合1バイトのスペースに変化する
csTemp.Replace( TWO_BYTE_SPACE, ONE_BYTE_SPACE );
//変化した文字列の長さ
iStrLen = csTemp.GetLength();
//▼文字列のスペースだけあるかどうかチェックする
for( int i = 0; i < iStrLen; i++ ){
if( csTemp[i] != SPACE ){
bDataFlag = true;
break;
}
}
[/code]
But still I'd love to see the proper way of identifying double byte
characters in an MFC program.
Please let me know if you know how to do it...
Thanks again for all the help!
.
- Follow-Ups:
- RE: How to identify two byte characters in an MFC program?
- From: Mihai N.
- RE: How to identify two byte characters in an MFC program?
- References:
- How to identify two byte characters in an MFC program?
- From: Sachintha
- How to identify two byte characters in an MFC program?
- Prev by Date: Re: Using Doxygen's \callergraph command ???
- Next by Date: Re: CRichEditCtrl::clear() doesn't work???
- Previous by thread: Re: How to identify two byte characters in an MFC program?
- Next by thread: RE: How to identify two byte characters in an MFC program?
- Index(es):
Relevant Pages
|