The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
URL encoding Vichu Shell Programming and Scripting 7 04-07-2008 08:03 AM
Encoding Problem while using "|" (PIPE) as delimiter from Mainframe to Unix seshendra UNIX for Dummies Questions & Answers 1 02-20-2008 01:36 AM
character encoding in Fedora6 bsky UNIX for Dummies Questions & Answers 1 01-04-2008 05:29 AM
encoding palmer18 UNIX for Dummies Questions & Answers 3 08-21-2007 06:35 AM
no SOAP encoding under unix? devotedsinner SUN Solaris 0 11-07-2005 03:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Red face File encoding in Unix

1. I have a shell script which creates a file using cat command. How can i find what encoding the file follows (e.g. UTF8, ANSI)?

2. I want to convert that file to PC-ANSI format. How can i achieve that?

I am using HP-Unix.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-04-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Actually file encoding should not be guessed or detected,
its better that is clarified from the originating source.

Since you have the control to create the file, it depends on the character set being used to create the file whether its ANSI / UTF-8/ LATIN-1/ SJIS

encoding conversion tests can be done using iconv command
Reply With Quote
  #3 (permalink)  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question File encoding in Unix

How do i set the character encoding/get it clarified in a Unix script? Is there any command?
Reply With Quote
  #4 (permalink)  
Old 02-04-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
check it from

Code:
echo $LANG
Reply With Quote
  #5 (permalink)  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question Unix encoding

echo $LANG doesnt work on my machine... Parameter not set!
Can anyone please tell me how to convert my files to Windows ANSI encoding in HP Unix? It would be great if you could give me the alias..
Reply With Quote
  #6 (permalink)  
Old 02-04-2008
Moderator
 

Join Date: Dec 2003
Location: /ksh93
Posts: 756
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Try the locale utility. It will display your current locale settings.
Reply With Quote
  #7 (permalink)  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question Unix file encoding

Its got LANG=
What does this mean?
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101