- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to check encoding of a file on hp-ux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 02:12 AM
тАО02-01-2011 02:12 AM
how to check encoding of a file on hp-ux
Many Thanks!
Shan
- Tags:
- encoding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 02:24 AM
тАО02-01-2011 02:24 AM
Re: how to check encoding of a file on hp-ux
You could easily know if the file was ASCII.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 03:02 AM
тАО02-01-2011 03:02 AM
Re: how to check encoding of a file on hp-ux
"iconv" command converts the encoding of characters in the input files from the fromcode code set to the tocode code set, and writes the results on standard output.
#man iconv
The full list of supported code sets is in /usr/lib/nls/iconv/config.iconv.
#iconv -f iso[nnn] -t utf8 current_file > final_utf8_file
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 05:08 PM
тАО02-01-2011 05:08 PM
Re: how to check encoding of a file on hp-ux
Thanks Jose for the suggestion of iconv.
My problem is,
I have program which will generate a file in UTF-8 format.
When this is run on machine A, the encoding of the output file is correct (i.e. UTF-8) and can be confirmed when this file is downloaded to Windows and open in Notepad.
However, when the same program run on machine B, the encoding of the output file is simply ASCII, and could only be verified after download to Windows and open in Notepad.
Thus, I would like to know if I can verify and confirm the file encoding on the unix machine. As I am afraid the encoding "may be" changed after the file downloaded (ftp) to PC.
Many Thanks!
Shan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 02:15 AM
тАО02-02-2011 02:15 AM
Re: how to check encoding of a file on hp-ux
Have you figured out the difference? Do you need to export LANG to set the locale?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 04:35 AM
тАО02-02-2011 04:35 AM
Re: how to check encoding of a file on hp-ux
Yes, I agree with Dennis about the environmental setting on your machine B, so please check possible differences between them, specially LANG variable.
#env
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2011 06:49 PM
тАО02-06-2011 06:49 PM
Re: how to check encoding of a file on hp-ux
Thanks for the suggested checking.
Machine A's PATH environment variable include /opt/langtools/bin, while this directory does not exist in Machine B!
Do you know which HP-UX software is missing on Machine B ?
Many Thanks!
Shan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2011 07:13 PM
тАО02-06-2011 07:13 PM
Re: how to check encoding of a file on hp-ux
I run this command (the last "wc" is just to reduce the output) and found that both machines are installed the same number of filesets that are related to "lang"
Machine A:
$ swlist -l fileset|grep -i lang| wc
76 621 7151
$
Machine B:
$ /usr/sbin/swlist -l fileset|grep -i lang|wc
76 617 7143
$
Does it mean the problem may not be due to missing "/opt/langtools" ?
Many Thanks!
Shan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2011 10:41 PM
тАО02-06-2011 10:41 PM
Re: how to check encoding of a file on hp-ux
This has nothing to do with character encoding.
>Do you know which HP-UX software is missing on Machine B?
Development tools like lex/yacc and gdb. On machine A:
swlist -l file | grep /opt/langtools
>both machines are installed the same number of filesets that are related to "lang"
Does it also mention locale?
>Does it mean the problem may not be due to missing /opt/langtools?
Exactly. langtools is for computer languages, not language locales.
You want to check for env vars, LANG and LC_* variables:
env | grep -e LANG -e LC_