1

need help My curl output shows chinese characters as (on Linux terminal)

기타/부재시 집 앞에 놓고가셔&#46104
  1. I need the output in chinese characters like (기타/부재시 집 앞에 놓고가셔되) OR-OR-oR
  2. how to convert these html to entities to chinese characters on terminal Please note I do not have php installed on my machine. so I can not use html_entity_decode or other php decode methods

I have perl and python installed on my machine.

choroba
  • 231,213
  • 25
  • 204
  • 289

1 Answers1

0

Just pipe the output through this simple Perl substitution:

perl -CO -pe 's/&#(\d+);/chr $1/ge'
  • -p reads the input line by line and prints each after processing
  • -CO turns on UTF-8 encoding of the output
  • /e evaluates the replacement part of the s/// substitution as code
  • chr just returns the character of the given number in the character set.
choroba
  • 231,213
  • 25
  • 204
  • 289
  • Thanks for answer, it's almost working, it still showing with semicolons, how can I remove these semicolons as below without using sed comand 기;타;/부;재;시; 집; 앞;에; 놓;고;가;셔;되; 됩;니;다;/박;태;현; it should be like 기타/부재시 집 앞에 놓고가셔되 됩니다/박태현 – Vijay Varma Mar 27 '18 at 01:20
  • Oh sorry, just include the semicolon in the replacement part. Edited. – choroba Mar 27 '18 at 06:30