Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

batch output to file charset problem

Posted on 2011-02-25
9
Medium Priority
?
2,409 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
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.

 
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

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.

Question has a verified solution.

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

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

604 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