digitalmars.D.learn - Asian characters are not printed propely in console
- Jun (291/291) Jan 04 2011 I'm sorry for posting in the wrong place.
- Vladimir Panteleev (15/16) Jan 04 2011 Place the following code anywhere at the top level in your program:
- bearophile (4/5) Jan 05 2011 File a bug report, with a little patch, then :-)
- torhu (9/14) Jan 05 2011 If you save the file as utf-8, and set the console to CP 65001 (which is...
I'm sorry for posting in the wrong place. I attached screenshot of my code and the result. As you can see, Korean letters get changed after compilation. This problem doesn't happen with user input(from readln() method). Should I use different type and prefix or suffix similary to C++? begin 644 캡처.PNG MB5!.1PT*& H````-24A$4 ```5<```$."`8````]L%0G`````7-21T(`KLX< MZ0````1G04U!``"QCPO\804````)<$A9<P``#L M5'A>[7UMLQS'>=WRY\ ?\U&_8%VIQ';)Y41.`1=TE56.R^6J5-W*AS"L4$DE ME W+KW+A;6%3M!0[BBQ&8E"T"5XL+DA)M&S:`(&+2QN*\$H"%"D2?`5`$NKT MD2$0``)``` HB"M(``2``!`8``&(ZP" (DL ``2`0"MQG6\K-9T!O&8$YFI[ M,E&3I0'EO_Y\>Z+K[RHJ$` ` 0$1:"6N`Y:G<]:SJ5+SSKGX,YA-MQ/RUP+7 MZ/M,Y&&^6P:*T\ES&7$^1M>693%BRF7(K\_G;R<J[4S?R(0<IW&=4S7E&]47 MG/+OXO]*_E::;0U"JK .>?VK&D"^-Y]SK5Q_XNI(KN Z/JSS>;)6=VO5,G`S M0*`C`DGBRM<B8:L9LES<C-CDPDI_4EH6(!;'0N_R<_ [':_D2_GHWRK_6+3Y M=_U="EP7YTKB(T6'AL_VL-[O'&D8/A6"DQX66-3U[>N4G9<5+M#QGWI8`^+: ML<WA]`U!H%]Q%8*G38_Y9XNK[22+XR2T^3D2>XKO5MRM%M.FD787<:5>P<1) M^*,,"] NU1$SGI_2]ZQCKM.70G#B. M-3GQ1!I%XKFMC\OSG1-C8E)*:IOK^K61;'YMUX18J*:KDSD4'G!,Z!A!Y="! M=;QR3*?1-UM?CM4DKC(DT??U[9"#XQX<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E[GR<XZQ29$,QUR;'V+5"NYS?Y5R?&UY&0^U+?+KBD4JNKM?K>G[L M2,:5+M00?1UR"C^ZWI_O_-2R=RU'*B^6E3Z$R^#E KB6\900Z4*5%3J_:V6F MYI^:?M'E:RN&L>5<QOTW<22VW'UUKEVOM^KGA]KKX/?7A[ .7LA5632,<J[> MAL:HL[6MLU&(JRVPJ6$!B&O+V40T[+5MV& 3:!,3^R$">T(+)`%)P`%P`!QH M``<L#LC7O M#H`#X MP`%PH",'(*X=`81+ 4L!!\`!%P=L<64'^]ACCP$P-!IP`!P`!]IR &.M,O:* M`M<"#H MC6R6&T%]H[YC.6`[5KS]%6(+QP(. `,]<,`65_J.L$`/P,;V;D ')P0.K"<' M6$QE[!7B"G&%<P$'P(&.'&!QQ8161R#A/M;3?:!>4:]M.0!QA:C"H8`#X 7'/C_! /)2;X`NP,`````245.1*Y"8((` ` end
Jan 04 2011
On Tue, 04 Jan 2011 11:47:32 +0200, Jun <blings naver.com> wrote:Should I use different type and prefix or suffix similary to C++?Place the following code anywhere at the top level in your program: version(Windows) { import std.c.windows.windows : SetConsoleCP, SetConsoleOutputCP; static this() { SetConsoleCP(65001); SetConsoleOutputCP(65001); } } This code should really be in the standard library, I think. -- Best regards, Vladimir mailto:vladimir thecybershadow.net
Jan 04 2011
Vladimir Panteleev:This code should really be in the standard library, I think.File a bug report, with a little patch, then :-) Bye, bearophile
Jan 05 2011
On 04.01.2011 10:47, Jun wrote:I'm sorry for posting in the wrong place. I attached screenshot of my code and the result. As you can see, Korean letters get changed after compilation. This problem doesn't happen with user input(from readln() method). Should I use different type and prefix or suffix similary to C++?If you save the file as utf-8, and set the console to CP 65001 (which is utf-8), it should work. Providing your console font suppports the characters, of course. You can add the suffixes 'w' or 'd' to get utf-16 or utf-32, respectively. But then you need to save the file in that encoding, and change the console code page accordingly. It all has to match up. But I would expect it to work with other character sets too, as long as the file encoding and the console match.
Jan 05 2011