Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What encoding does cmd of win xp use ?

Let's say I'm trying to get some ascii box characters which show fine in cmd, in some text editor ? What enc. would I need to put it in ? Since it comes out as garbage.


write(*,*) char(218),char(196),char(196),char(191)
write(*,*) char(179),'22'      ,char(179)
write(*,*) char(179),'22'      ,char(179)
write(*,*) char(192),char(196),char(196),char(217)
end
share|improve this question
    
Can you provide more details please? Exactly what input do you have and what output are you expecting? –  ChrisF Feb 17 '10 at 12:25
    
I?m using a sample program (part of a much larger one) to draw box characters to a file. When viewed in cmd it looks fine (ascii box lines). But when opened with let's say vim, it looks like garbage. So I assumed it was a matter of encoding/codepage ... –  ldigas Feb 17 '10 at 12:28
    
Generally, the output of the above looks like a box around numbers 22 in two rows. –  ldigas Feb 17 '10 at 12:29
    
You might be better off if this was on Stack Overflow as it's beginning to sound like a programming question. If it is it'll get migrated so all you have to do is create an account and link it to your Super User one. –  ChrisF Feb 17 '10 at 12:30
    
There is a similar one out there as well (under some different assumptions), not many answers, none useful ... in any case, I'll let it stay here ... maybe someone will know. This is not a programming issue, I can draw box chars in cmd by typing them. This is a codepage issue. –  ldigas Feb 17 '10 at 12:32

1 Answer 1

up vote 1 down vote accepted

To receive the actual codepage use this command:

mode con cp
share|improve this answer
    
(btw, if you wish look for my question on SO as well regarding vim/vertsplit and i'll accept it there too). been too long since i've done anything but trivialities in cmd, and it's starting to show. so, a big thanks for this ! –  ldigas Feb 17 '10 at 12:58
    
chcp works too. –  grawity Feb 17 '10 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.