Operating System - HP-UX
1834788 Members
2966 Online
110070 Solutions
New Discussion

codepages, the saga begins

 
Systeemingenieurs Infoc
Valued Contributor

codepages, the saga begins

The facts :
---------

- hpux 11.0
- codepage on unix : hp-roman8
- codepage on winNt : cp1252 (iso 8859-1 is +/- the same)
- eurosign-position in roman8 : 0xa4
- eurosign-position in cp1252 : 0x80


the question :
------------

how the hell can i convert the eurosign from hp-roman8 to cp1252 ?


the futile tries :
----------------

# first thought
echo "\0244"|iconv -f roma8 -t iso81|xd -N 1
-> returns 0xca, not 0xa4

# aha, iso81 has an euro-successor : iso815
echo "\0244"|iconv -f roma8 -t iso815|xd -N 1
-> iconv: can not initialize the conversion
-> no direct conversion possible

# the workaround :
echo "\0244"|iconv -f roma8 -t ucs2|iconv -f ucs2 -t iso815|xd -N 1
-> returns 0xca, not 0xa4

# maybe iso81 is not the same as cp1252
# good thing : mq-series installs a cp1252 on the system !
echo "\0244"|iconv -f roma8 -t cp1252|xd -N 1
-> returns 0xca, not 0xa4


conclusion :
----------

the force is not with me
A Life ? Cool ! Where can I download one of those from ?
5 REPLIES 5
Paula J Frazer-Campbell
Honored Contributor

Re: codepages, the saga begins

Hi

I may be on the wrong track but:- ux2dos ?


Paula
If you can spell SysAdmin then you is one - anon
Systeemingenieurs Infoc
Valued Contributor

Re: codepages, the saga begins

the dos codepage is cp850 ; so i assume that the conversion will be wrong. I'll check it out, though.
A Life ? Cool ! Where can I download one of those from ?
Systeemingenieurs Infoc
Valued Contributor

Re: codepages, the saga begins

echo "\0244"|ux2dos|xd -N 1
-> returns 0xa4

BUT, i made a mistake, all the commands should return 0x80 (the input is 0xa4). My mistake.
A Life ? Cool ! Where can I download one of those from ?
benoit Bruckert
Honored Contributor

Re: codepages, the saga begins

My be the tr command (tr '\octal' '\octal' ) just for the euro sign ?
hth
Benoit
Une application mal pansée aboutit à une usine à gaze (GHG)
Systeemingenieurs Infoc
Valued Contributor

Re: codepages, the saga begins

you are correct benoit, it is a solution (one we used in the past). Problem is that you create a historical *pile.

i'm keeping it as a last aid.

thx
A Life ? Cool ! Where can I download one of those from ?