Operating System - HP-UX
1833793 Members
2440 Online
110063 Solutions
New Discussion

can not convert UTF-8 to US-ASCII HPUX

 
SOLVED
Go to solution
Barbara Kramer
Frequent Advisor

can not convert UTF-8 to US-ASCII HPUX

Hi,
I have a html file, which I need to read into the erp.
The html file is UTF-8 format. I try to change to ascii for reading in
I always get error message:
can not convert UTF-8 to US-ASCII
what do I need to convert
OS: HPUX 11.11
live is great !!
2 REPLIES 2
Matti_Kurkela
Honored Contributor
Solution

Re: can not convert UTF-8 to US-ASCII HPUX

You left out one important thing: what's the name of the conversion tool you're using?

UTF-8 is much "larger" character set than US-ASCII. If the UTF-8 file uses any of those characters that are outside US-ASCII, it is not possible to convert those characters into a single-USASCII-character units without losing information. This may be why your conversion tool is refusing to work.

(Let's see whether this forum can handle UTF-8...)

For example, here's the Euro sign: "â ¬".
As UTF-8, it is a single character. But when you convert it to US-ASCII, there just isn't any equivalent available. Some possible methods are:

- Convert a single UTF-8 character to a suitable multi-character representation: "â ¬" might become "EUR". This will lengthen some lines and may screw up the alignment of columns. In some cases this is not acceptable, so a generic conversion program cannot do this unless given an explicit permission to do so.

- Convert it to the closest possible single-character look-alike: "â ¬" becomes "E". This will make the conversion non-reversible: some information is lost. This is not acceptable in all cases either.

- Discard the characters that cannot be converted: this will *definitely* lose information, so it is acceptable in special cases only.

If you're using GNU "recode" utility to do the conversion, it needs a "-f" option to allow non-reversible conversions. You can also choose what happens to characters that cannot be converted: read the documentation of "recode" for details. (GNU recode is available in the HP-UX Porting Archive.)

If you're using some other tool for the conversion, you may need to do something similar.
MK
Barbara Kramer
Frequent Advisor

Re: can not convert UTF-8 to US-ASCII HPUX

Hi,
thanks a mill for your solution.
I already solved it.
Barbara
live is great !!