RE: How to identify two byte characters in an MFC program?



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!

.



Relevant Pages

  • RE: Whitespace in passwords
    ... characters (including whitespaces). ... > Audit your website security with Acunetix Web Vulnerability Scanner: ... Up to 75% of cyber attacks are launched on shopping carts, ...
    (Pen-Test)
  • Re: reading text file with MFC
    ... This is a newbie question so I hope somebody can help me. ... with 4 columns delimited by whitespaces. ... What do I do if the product name contains a digit? ... barcode I would have to count the characters to the "beginning" from the ...
    (microsoft.public.vc.mfc)
  • Re: String and whitespace problem
    ... On 21-2-2005 9:43, Sharp wrote: ... >>I have a sting that contains long stretches of whitespaces between ... >>I would like to include all the characters including the white spaces into ... > I forgot to mention that Iam wrapping the characters using the Character ...
    (comp.lang.java.programmer)
  • Re: String and whitespace problem
    ... > I have a sting that contains long stretches of whitespaces between ... > I would like to include all the characters including the white spaces into ... > So I tried using the replaceAllmethod from the string class, ... I forgot to mention that Iam wrapping the characters using the Character ...
    (comp.lang.java.programmer)
  • Access 2003 Combo problem
    ... major problems. ... characters long) and the two letter combination in the other field (2 ... two letters display. ... generating this error message? ...
    (microsoft.public.access.formscoding)