|
빠른 답변 고마웠습니다...
그리고 해결했습니다....
10바이트를 맥스로 주고...
젤첨 코드를 검사해서 한글이면 2바이트만 읽어오고
한글이 아니면 1바이트만 읽어오는 루틴을 만들었습니다...
void __fastcall TFormLogin::BitBtn1Click(TObject *Sender)
{
String name = "아II시JJ아S나K항공";
int size = name.Length();
char *buf = new char[size+1];
memset(buf, 0, size+1);
memcpy(buf, name.c_str(), size);
int maxnum = 10;
char *result = new char[maxnum+1];
memset(result, 0, maxnum+1);
bool hangul = false;
for(int i=0; i<maxnum; i++)
{
if(hangul)
hangul = false;
continue;
}
if(buf[i] > 0x80) // 한글값???몬가
{
hangul = true;
memcpy(&result[i], &buf[i], 2);
}
else
{
hangul = false;
memcpy(&result[i], &buf[i], 1);
}
}
ShowMessage(StrPas(result));
}
|