0

Is it possible to decode string using shell script? For instance, decoding this string

//Starbucks// 

will give us "Starbucks". I have used https://coderstoolbox.net/string/#!encoding=xml&action=encode&charset=none for the decoding. Is there any way we can do this decoding using Shell script or python maybe? Please help me.

mzjn
  • 45,711
  • 11
  • 120
  • 232
Kumar
  • 23
  • 8
  • That string is not XML. What you have is a sequence of numeric character references. See https://en.wikipedia.org/wiki/Numeric_character_reference – mzjn Sep 22 '21 at 14:30
  • `//Starbucks// ` is not xml. If you need help with xml parsing - post a **VALID** xml document and ask a question – balderman Sep 22 '21 at 14:30
  • mzjn, Thanks for editing. – Kumar Sep 22 '21 at 14:31
  • Python solution: use `html.unescape`: https://stackoverflow.com/a/2087433/407651 – mzjn Sep 22 '21 at 14:42
  • @Kumar : You find other solutions [here](https://stackoverflow.com/questions/5929492/bash-script-to-convert-from-html-entities-to-characters). – user1934428 Sep 23 '21 at 09:01

0 Answers0