본문 바로가기
생활일기/tip tech

플래시에서의 외부 텍스트 호출시 한글문제

by 신일석 2009. 6. 23.
플래시 플레이어는 외부텍스트를 읽어 들일때 유니코드를 사용합니다. 그러나, 윈도우의 경우는 EUC-KR(51949)가 기본 캐릭터 셋이기 때문에 한글이 깨지는 경우가 발생합니다.



이럴때 우리가



System.useCodePage = true;



를 사용하면 한글이 보이게 되는데 'true'이면 '시스템의 캐릭터 셋'으로 읽어 들이게 되기 때문입니다.

useCodePage property에 대해



System.useCodePage = true;



When this code is present, the application interprets external text using the traditional code page of the operating system. This is generally CP1252 for an English Windows operating system and Shift-JIS for a Japanese operating system. If you set useCodePage to true, Flash Player 6 and later treat text as Flash Player 5 does. (Flash Player 5 treated all text as if it were in the traditional code page of the operating system running the player.)


요즘은 유니코드로 작성된 글이 많지만, 아래 소개한 원강민님이 RSS리더기를 개발하면서 EUC-KR과 UTF-8외에 다양한 인코딩으로 작성된 존재하고 이에 대한 코드가 올려져 있어 소개합니다.

'생활일기 > tip tech' 카테고리의 다른 글

TypeError: Error #1009  (1) 2009.06.23
Swift 3D v6.0이 PaperVision3D v2.0 지원  (0) 2009.06.21
Flash Catalyst 이용시의 작업과정  (0) 2009.06.18