Solved

batch output to file charset problem

Posted on 2011-02-25
9
2,253 Views
Last Modified: 2012-05-11
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
Comment
Question by:bergsprekken
  • 5
  • 3
9 Comments
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34978129
Have you tried opening it in a different text editor, this is probably a limitation of notepad
0
 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 34978133
try in your script command chcp
0
 

Author Comment

by:bergsprekken
ID: 34978187
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
 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 34978195
and what encoding and character set show you notepad++ ?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 34978227
here is very good description about character coding in command window.
http://www.sqlsnippets.com/en/topic-13410.html
0
 

Author Comment

by:bergsprekken
ID: 34978246
The Format menu in notepad++ shows that ANSI is selected..
0
 
LVL 9

Accepted Solution

by:
Tomas Valenta earned 500 total points
ID: 34978248
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
 

Author Closing Comment

by:bergsprekken
ID: 34978309
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
 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 34978332
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now