batch output to file charset problem

My batch file contains a dsget command to get the names in a group, this works but its piped out to a .txt file and when i open this file in notepad to see the results all the names that has æ ø å special chars in them look strange. Looks like the batch file outputs other chars instead of æ ø å norwegian chars. Is it possible to set the charset or something in the bat file so that it will display these chars? if i output it to the dos prompt it displays it correctly.
bergsprekkenAsked:
Who is Participating?
 
Tomas ValentaIT ManagerCommented:
I tested myself and think the problem is in edito which is not able to recognize character coding of file.
In my command is codepage 852 and Notepad++ show me the file in ANSI coding - if I manualy changed
it to Central European OEM 852 then the text was readable correctly. Try to do it like I
0
 
Glen KnightCommented:
Have you tried opening it in a different text editor, this is probably a limitation of notepad
0
 
Tomas ValentaIT ManagerCommented:
try in your script command chcp
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
bergsprekkenAuthor Commented:
I have chcp 850 on the first line of the bat file.

æøå is displayed correctly in the msdos prompt window

In the textfile whereever æ ø or å was supposed to be theres: ‘ › or † (tested both notepad and notepad++)
0
 
Tomas ValentaIT ManagerCommented:
and what encoding and character set show you notepad++ ?
0
 
Tomas ValentaIT ManagerCommented:
here is very good description about character coding in command window.
http://www.sqlsnippets.com/en/topic-13410.html
0
 
bergsprekkenAuthor Commented:
The Format menu in notepad++ shows that ANSI is selected..
0
 
bergsprekkenAuthor Commented:
Thanks that worked, selected charset western european 850 in notepad++ and it showed correctly. I could then even copy the text to notepad and it showed correctly too.
0
 
Tomas ValentaIT ManagerCommented:
If you configure Notepad++ - Preferences/New Document/Default Directory
and here Encoding - UTF-8 without BOM and check Apply to opened ANSI files and
then I thonk you will see all characters correctly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.