utf8 ¹®ÀÚ¿°ú lazarus°¡ ¸»½éÀ̱淡, ÃÖ±Ù ¹ö±×¸®Æ÷Æ®µµ ÀÖ°í Çؼ ¿½ÉÈ÷ ¸¸µé¾îºÃ½À´Ï´Ù. ÀÌ ÆÐÄ¡¸¦ Àû¿ëÇϸé, rawbytestring¿¡ ´ëÇØ ÀÎÄÚµù º¯È¯À» ÇÏÁö ¾Ê´Â ¹®ÀÚ¿ ÇÕÄ¡±â¸¦ ÇÕ´Ï´Ù.
½ÇÁ¦·Î rawbytestringÀº Àμö¿¡¸¸ »ç¿ëµÇ°Å³ª, º¯¼ö·Î »ç¿ëÇصµ ansistring°°ÀÌ Ã³¸®µÇ°í Àִµ¥, ÀÌ°Ô °á±¹ lazarus³»ºÎ¿¡¼ utf8 ¹®ÀÚ¿°ú ÇÕÃÄÁú ¶§, ÀÎÄÚµùÀÌ ¸Á°¡Á® ¾Ë ¼ö ¾ø´Â ¹®ÀÚ°¡ µÇ´Â Çö»óÀÌ ÀÖ°ï ÇÕ´Ï´Ù.
´ëÇ¥ÀûÀÎ°Ô memoÀÇ add¸¦ ÇßÀ» °æ¿ìÀε¥, Àμö·Î Á¦´ë·Î ³Ñ¾î°¡Áö¸¸ lazarus³»ºÎ¿¡¼ ÀÎÄÚµùÀÌ ±úÁö°ï ÇÕ´Ï´Ù.
±× ¹®Á¦¿¡ ´ëÇÑ »ðÁúÀ» Á» ÇغýÀ´Ï´Ù.
ÇÒ´çµÇ´Â º¯¼ö°¡ rawbytestringÀ̰ųª ¹®ÀÚ¿ ÇÕÄ¡±â ¾Õ¿¡ rawbytestringŸÀÔ Ä³½ºÆÃÀ» ÇÏ¸é ¹®ÀÚ¿ÀÇ ÀÎÄÚµù¿¡ »ó°ü¾øÀÌ ±×³É ´õÇϱ⸸ ÇÕ´Ï´Ù.
program project2; uses sysutils; var s1 : string; sw, sh : widestring; s2, s3, s4, s5, dumps : string; s : string; i : integer; begin s1:='1234'; s2:='Grö©¬e ÄÜÖ'; s3:='abcd'; s5:='ÇѱÛ'; sw:=UTF8Decode(s2); s2:=UTF8Encode(sw); s4:=UTF8Encode(sw); sh:=utf8decode(s5); s5:=#199#209; //s5:=ansitoutf8(s5); s :=rawbytestring(s1+s2)+rawbytestring(s3+s4)+rawbytestring(s4+s5); s :=rawbytestring(s1+s2+s3+s4+s5)+rawbytestring(s1+s2+s3+s4+s5)+utf8string(s1+s2+s3+s4+s5); dumps:=''; for i:=1 to Length(s) do begin dumps:=dumps+' '+IntToHex(Byte(s[i]),2); end; writeln(s,' ',dumps); readln; end.
´ëÃæ ÀÌ·± ÆÐÅÏÀ¸·Î »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
|