Solved

batch output to file charset problem

Posted on 2011-02-25
9
2,314 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 34978195
and what encoding and character set show you notepad++ ?
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Powershell to pull all Service accounts 1 64
AWS CLI - Instances, Volumes & Tagging 2 113
batch file problem 5 68
windows explorer default details view 10 85
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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