www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Asian characters are not printed propely in console

reply Jun <blings naver.com> writes:
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,```[#`<=OJ&0``#$^241!
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
MTS//S#,]W=/=\[([NWM0M86[.ST]/:=/GS[]=$_/1.$?$``"0``(]([`I/<<
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
ML[ N^_H#0HNL <!:(9`DKE>U6]5FS'PJFJ%-T)1^U\*F39$Y/M<*QVE)[$CT
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)
MBT_=N7G%51>TY ;)R2:%!19S?:>X4ED=-G^^+3N,#6D5N$T T`,""Q=7.PPP
M+G&U77+=N0TKKHNY/L2UAY:#+(!``(&%BZ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O+#`(N:*AH*&` Z``QTY(#?)AKAV!!-#00P%P0%P #D`<86 PJ&`
M`^#``!RPWY^%)[0&`!EN!FX&'- \#K1]02%Z.H P.``. `,-'&CS D(`BD8%
M#H`#X$"``]A;`(T$C00<``<&X`#$=0!0$5_;O/ :ZAQU;G,`X IQA6L!!\"!
M`3B`7;$&`!4N!BX&'``'(*X05[ 6<``<&(`#]* KMAP<`% X%S 7<&"S.4#B
M: LL]A:`V,+) `/ 0$<.L+A* 86X= 05CF6S'0OJ'_5/'.#'7:6#A;A"7.%:
MP`%PH",'(*X=`81+ 4L!!\`!%P=L<64'^]ACCP$P-!IP`!P`!]IR &.M,O:*
ML`#<+(:$X``XT)$#$->.`+;MU7`>'!$XL-X<L">RZ/O#AP\5P (073 7<``<
MZ,`!.QP`<>T`)IS(>CL1U"_J-X4#]CI7B"O$%6X%'``'>N``Q+4'$%-Z,Z2%
M^P$'-H,#"`M`7.%2P`%P8``.0%P'`!7.9#.<">H9]=S$`9>X8ITK!!=.!AP`
M!SIRP!97O%J[(Z!P,W`SX``X0!S`KE 04S 4<``<&(`#$-<!0(5S 7,!!\`!
MA`4 KG`MX``X,``'(*X# `K7`M<"#H`#$%>(*UP+.``.#,`!B.L`H,*UP+6`
M`^``'B*`N,*U `/ P``< + .`"I<"UP+.``.0%PAKG`MX``X,``'(*X# `K7
M`M<"#H`#]-8!6V#Q) ((+IP,.``.=.0`Q+4C '`H<"C `#C X #"`A!7.!1P
M`!P8 `/\6A<IL  +#``TW`W<#3BP61Q 497A`8 KQ!5.!AP`!SIR`&&!C #"
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
next sibling parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
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
parent bearophile <bearophileHUGS lycos.com> writes:
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
prev sibling parent torhu <no spam.invalid> writes:
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