Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2428
  • Last Modified:

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.
0
bergsprekken
Asked:
bergsprekken
  • 5
  • 3
1 Solution
 
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
 
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now