www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - some problems with cyrilic output

reply bobef <bobef_member pathlink.com> writes:
i try to use d to write a cgi app...
when i try to write some cyrilic characters
it works fine with files but when i writef same string
internet explorer displays *something* (that does not look like
my string :)... i do the same in c++ and the output is ok.
also if i output a cyrilic string to file with c++ (m$vc++6)
and then open this file with d (FileMode.Out) the output
is like in the ie (broken)...
someone know something about this?

if it can help i use:
editplus to edit .d and save files as utf-8
apache 2 for windows
internet explorer 6
Aug 05 2004
next sibling parent "Walter" <newshound digitalmars.com> writes:
"bobef" <bobef_member pathlink.com> wrote in message
news:cetvr2$1vsi$1 digitaldaemon.com...
 i try to use d to write a cgi app...
 when i try to write some cyrilic characters
 it works fine with files but when i writef same string
 internet explorer displays *something* (that does not look like
 my string :)... i do the same in c++ and the output is ok.
 also if i output a cyrilic string to file with c++ (m$vc++6)
 and then open this file with d (FileMode.Out) the output
 is like in the ie (broken)...
 someone know something about this?
Sure. The trick is to save your source file in UTF format. Odds are that you are saving it in the format where the upper 128 bytes are indices into the current "code page".
 if it can help i use:
 editplus to edit .d and save files as utf-8
 apache 2 for windows
 internet explorer 6
You'll also need to tell your display program (explorer) that your data is in UTF format.
Aug 05 2004
prev sibling parent reply J C Calvarese <jcc7 cox.net> writes:
In article <cetvr2$1vsi$1 digitaldaemon.com>, bobef says...
i try to use d to write a cgi app...
when i try to write some cyrilic characters
it works fine with files but when i writef same string
internet explorer displays *something* (that does not look like
my string :)... i do the same in c++ and the output is ok.
also if i output a cyrilic string to file with c++ (m$vc++6)
and then open this file with d (FileMode.Out) the output
is like in the ie (broken)...
someone know something about this?

if it can help i use:
editplus to edit .d and save files as utf-8
apache 2 for windows
internet explorer 6
I think the problem could be any number of things. Do you have trouble viewing other Cyrillic websites? You might need to install an IE language pack from windowsupdate.microsoft.com. But that's probably not your problem, so I'll guess again... Maybe you need to set up Apache to output the correct encoding type. Also, you could try running another browser (such as Mozilla Firefox) on the web site and see if the page looks different. From your description, the problem could be almost anything. I'm just throwing out ideas to consider. If you post some D code (or even C++ code), someone might spot a problem there, too. jcc7
Aug 05 2004
parent reply bobef <bobef_member pathlink.com> writes:
thanks... it works fine if i set ie's encoding to unicode...
Aug 05 2004
parent Sebastian Beschke <s.beschke gmx.de> writes:
bobef wrote:
 thanks... it works fine if i set ie's encoding to unicode...
 
There is a meta tag in HTML that lets you specify the encoding: <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> Haven't tried it, but the browser should then interpret the page as UTF-8. Saves you (and your user) from setting the encoding manually. Sebastian
Aug 06 2004