형변환

Unicode 시대

Unicode 시대로 가기가 힘들다


MBCS에서 UNICODE로 가기위해서 Type Casting 해야될 것이 많다.
그래서 일이 있을 때마다 여기에 정리해본다.


유니코드와는 관계없이 형변환 방법을 정리

CSting to TCHAR


CString strTest(_T("가나다ABC아라요"));
TCHAR cTest[255];
swprintf(cTest,strTest.GetBuffer(strTest.GetLength()));


CSting to char*


CString strTest;
char *cTest;
cTest=strTest.GetBuffer(strTest.GetLength());


CSting to int


int CString2Int(CString str)
{
int val= 0;
int tmp = 0;
while (str.GetLength()) {
if (!isdigit(str[0])) return -1;
tmp =str[0] - '0';
val= val* 10 + tmp ;
str= str.Right(str.GetLength()-1);
}
return val;
}

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by shiftkey

2008/11/27 08:43 2008/11/27 08:43
, , , , ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/177

Unicode 시대로 가기가 힘들다

Unicode 시대 에 쓴데로 이제 나도 Unicode로 가려하는데
길이 만만치 않다.

그동안 MBCS(Multi-byte CharacterSet)으로 해왔던 프로젝트에서
사용했던 라이브러리들을 새로 적용하기 위해서는
변경해줘야 할 것들이 너무나도 많다.

으아~ 누가 이 버그들을 모두 잡아주세요.
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by shiftkey

2008/11/27 08:33 2008/11/27 08:33
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/176

« Previous : 1 : Next »

블로그 이미지

Shiftkey가 살아가는 이런 저런 이야기......

- shiftkey

Tag Cloud

Notices

Archives

Categories

Authors

  1. shiftkey

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
161236
Today:
17
Yesterday:
243
Subscribe to RSS articles Subscribe to RSS responses Subscribe to ATOM articles Subscribe to ATOM responses