Im doing some changes in Linux locale files /usr/share/i18n/locales (like pt_BR), to change the default format of dates, time, numbers, etc. But since unicode chars are presented as strings in the <U9999> format, text is very hard to read.
Here is a snippet of it:
LC_TIME
abday "<U0044><U006F><U006D>";"<U0053><U0065><U0067>";/
"<U0054><U0065><U0072>";"<U0051><U0075><U0061>";/
"<U0051><U0075><U0069>";"<U0053><U0065><U0078>";/
"<U0053><U00E1><U0062>"
So, how to make a simple script (may be bash, python, pearl, whatever) to convert this text replacing the <Uxxxx> codes to their ASCII equivalents? (yes, they are all ASCI chars below 255, most even below 127)
If several answers are received, Ill accept the most elegant and/or the more detailed explained one (like options and flags used in comands)
As an example, the above text would be converted to:
LC_TIME
abday "Dom";"Seg";/
"Ter";"Qua";/
"Qui";"Sex";/
"Sáb"
Bonus points for another script that could do the opposite: convert all chars of a given string to <Uxxx> format.
Thanks!
latin1in your case. - John Machin