바이트를 문자로 변환하려고 할 때 flex는 유니 코드 번호 0 (NUL)을 만나면 변환을 중지합니다. 왜 그래야만하지? Flex는 0을 제외한 1-256 개의 유니 코드 숫자를 변환 할 수 있습니다. 유니 코드 번호에서 문자열 메시지를 작성하는 동안 매개 변수가 0으로 시작 되었기 때문에 경고 창에 텍스트가 표시되지 않습니다.플렉스 문자열이 유니 코드 0을 지원하지 않는 이유는 무엇입니까?
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="Alert" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="init();">
<s:controlBarContent>
<s:Button id="btn"
label="Show alert"
click="init();"/>
</s:controlBarContent>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
protected function init():void {
// if string message value is String.fromCharCode(78,0);, then Alert displays as N
//Here, since message starts with unicode character 0, Alert displays nothing.
//Flex string is getting stopped if it encounters unicode 0, why is it so?
//but flex string supports other contorl ascii characters except NUL (0)
var message:String=String.fromCharCode(0, 78, 1);
Alert.show(message, "", Alert.YES | Alert.NO | Alert.OK | Alert.CANCEL);
}
]]>
</fx:Script>
</s:Application>
왜 flex가 유니 코드 0 문자를 변환 할 수 없는지 잘 모르겠습니다. 일시적으로 0이면 32 (공백)로 변환합니다. 미리 감사드립니다.