Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Get PC437 encoding for character

Im trying to get the PC437 hex for a character in Javascript.

console.log('£'.charCodeAt(0).toString(16)) // 'a3'

if i run toString(16) i get the UTF-16 code for the character which is 'a3' which is correct as per here: https://en.wikipedia.org/wiki/Code_page_437

However i need to get 'c9' for that particular character which would be the PC437 hex interpretation for the character?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I published a simple package for legacy CP437(CCSID 437) table. cp437

Usage:

const cp437 = require('cp437')

// find by symbol
console.log('// find by symbol')
console.log(`('£', 'hex') -> ${cp437.bySymbol('£', 'hex')}`)
console.log(`('£', 'dec') -> ${cp437.bySymbol('£', 'dec')}`)
console.log(`('â', 'hex') -> ${cp437.bySymbol('â', 'hex')}`)
console.log(' ')

// find by hex
console.log('// find by hex')
console.log(`('B0', 'symbol') -> ${cp437.byHex('B0', 'symbol')}`)
console.log(`('EC', 'symbol') -> ${cp437.byHex('EC', 'symbol')}`)
console.log(' ')

// find by dec
console.log('// find by dec')
console.log(`('175', 'symbol') -> ${cp437.byDec('175', 'symbol')}`)
console.log(`('155', 'hex') -> ${cp437.byDec('155', 'hex')}`)

Output:

// find by symbol
('£', 'hex') -> 9C
('£', 'dec') -> 156
('â', 'hex') -> 83

// find by hex
('B0', 'symbol') -> ░
('EC', 'symbol') -> ∞

// find by dec
('175', 'symbol') -> »
('155', 'hex') -> 9B
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!