- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Determine codepage for file in 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
Forums
Discussions
Discussions
Discussions
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
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
01-23-2008 06:36 AM
01-23-2008 06:36 AM
Determine codepage for file in HP-UX
e.g linux RedHat file -i
Any suggestions?
Best regards
Niclas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2008 08:01 AM
01-23-2008 08:01 AM
Re: Determine codepage for file in HP-UX
file
-i is not supported.
See the man page for other options.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2008 11:28 PM
01-23-2008 11:28 PM
Re: Determine codepage for file in HP-UX
I am aware that files -i does not exist on HP-UX but I am lookig for some command in HP-UX that does the same thing as file -i does in Linux.
Best regards
Niclas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2008 03:36 AM
01-24-2008 03:36 AM
Re: Determine codepage for file in HP-UX
And on 11.31, -i says don't do anything more than check for a "regular file".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2008 05:54 AM
01-24-2008 05:54 AM
Re: Determine codepage for file in HP-UX
For example: it cannot tell iso-8859-1 and iso-8859-15 apart in plain text files. It will list both as iso-8859-1.
I believe the correct term would be "character encodings" instead of IBMese "codepages".
Do you need to identify any possible character encoding, or can you reasonably assume that the files will use one out of some known set of encodings? If the latter, what encodings can be expected?
Some encodings simply cannot be identified without some extra metadata or the ability to understand the meaning of the data.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2008 10:57 PM
01-31-2008 10:57 PM
Re: Determine codepage for file in HP-UX
That's correct Matti I am after the character encoding.
In Linux if I have made a file with LANG set to en_US.UTF-8 and create a file then file -i returns
hba.txt: text/plain; charset=us-ascii
But if I set LANG to sv_SE.iso885915 and create a file file -i returns test.txt: text/plain; charset=iso-8859-1
How do I accomplish this in HP-UX since file -i don't exist?
I notice that this might be missleading sometimes if, as you say, file -i "cannot tell iso-8859-1 and iso-8859-15 apart in plain text files" but I think I can live with that.
Best regards
Niclas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2008 01:16 AM
02-01-2008 01:16 AM
Re: Determine codepage for file in HP-UX
If you use Scandinavian characters (åäöà à à ), Euro signs or other non-US-ASCII characters, only then will the different encodings produce different results.
Fortunately, the difference between iso8859 encodings and UTF-8 is easy to detect by eye: if you see a single Scandinavian character expressed as _two_ characters, the data is UTF-8 and it's being mis-interpreted using iso8859-style encoding.
If all the Scandinavian characters are displayed as some generic "invalid symbol" characters (depends on the font, but may be a square standing on one corner with a question mark in it) or no character at all, you're most likely seeing an iso8859-style file mis-interpreted as UTF-8.
Also remember that simply changing your LANG setting may not be enough: you should also check the settings of your terminal emulator.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2008 01:26 AM
02-01-2008 01:26 AM