Unicode 로 코딩하기 UNICODE <Convert> MBCS(수정중)

보호된 글 입니다. 비밀번호를 입력하세요.

Unicode 에서는 _countof() 를 쓰자!!!

템플릿을 써서 클래스를 선언하고
그걸 이용해서 뭐 초기화를 시키고 이상한 뻘짓 했는데

이상하게 그전에 선언되어있던
분명히 로컬 변수(CString)의 값들이 사라져버리는 거였다.

난 지운적이 없는데 -_-;

이 문제만 찾는데 20분은 소요된듯 했다.

결국 문제는 wcscpy_s(FileName, wcslen(FileName),_T("")); 이런식으로 사용했기 때문이다.

해결은
_countof() 매크로
를 써서 해결했다 -_-;

아우...유니코드로 코딩하기가 매우 귀찮군!!!

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

Posted by shiftkey

2008/12/17 12:23 2008/12/17 12:23
, , , , ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/195

형변환

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로 코딩해보자.

쉽게 될까?

가시밭길이 아니길 바랄뿐이다.

MS에 종속된 노예인 내가
MS에서 하라면 해야지
뭔 토를 달수 있겠는가

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

Posted by shiftkey

2008/11/25 14:47 2008/11/25 14:47
, ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/175

« Previous : 1 : Next »

블로그 이미지

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

- shiftkey

Tag Cloud

Notices

Archives

Categories

Authors

  1. shiftkey

Calendar

«   2012/02   »
      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      

Site Stats

Total hits:
135406
Today:
142
Yesterday:
312
Subscribe to RSS articles Subscribe to RSS responses Subscribe to ATOM articles Subscribe to ATOM responses