?
Solved

batch output to file charset problem

Posted on 2011-02-25
9
Medium Priority
?
2,397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

762 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