Hi all,
I am reading a file from the web into Stata that contains Hindi text in Devanāgarī script. Some Devanāgarī characters display correctly in Stata graphs, but not in my Results window. This differs from Arabic, Chinese, Japanese, and Cyrillic scripts, which render correctly in both graphs and the Results window.
When I copy and paste the Results window contents into my editor (Emacs on Linux), all characters appear correctly, suggesting a rendering rather than an encoding problem. I suspect the issue is related to the font used in the Results window, but I have not been able to identify a font setting that fixes it.
Any hints how to solve this would be greatly appreciated.
Here is an example of how to read the file, in case anyone wants to try it out:
I am reading a file from the web into Stata that contains Hindi text in Devanāgarī script. Some Devanāgarī characters display correctly in Stata graphs, but not in my Results window. This differs from Arabic, Chinese, Japanese, and Cyrillic scripts, which render correctly in both graphs and the Results window.
When I copy and paste the Results window contents into my editor (Emacs on Linux), all characters appear correctly, suggesting a rendering rather than an encoding problem. I suspect the issue is related to the font used in the Results window, but I have not been able to identify a font setting that fixes it.
Any hints how to solve this would be greatly appreciated.
Here is an example of how to read the file, in case anyone wants to try it out:
Code:
. copy https://hi.wiktionary.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%95%E0%A5%8D%E0%A4%B7%E0%A4%A8%E0%A4%B0%E0%A5%80:%E0%A4%A6%E0%A5%87%E0%A4%B6%E0%A5%8B%E0%A4%82/%E0%A4%B0%E0%A4%BE%E0%A4%B7%E0%A5%8D%E0%A4%9F%E0%A5%8D%E0%A4%B0%E0%A5%8B%E0%A4%82_%E0%A4%95%E0%A5%87_%E0%A4%A8%E0%A4%BE%E0%A4%AE country_code_hi.txt
. filefilter country_code_hi.txt x.txt, from(`"<tr "') to(\n) replace
. import delimited using x.txt, stripquotes(yes) delimiters("\t") encoding(UTF-8) clear
. gen iso2 = ustrtrim(ustrregexs(1)) if ustrregexm(v1,`"<td.+?>([A-X]+)</td><td.+?>.+?</td><td.+?>(.+?)</td>"')
. gen name_hi = ustrtrim(ustrregexs(2)) if ustrregexm(v1,`"<td.+?>([A-X]+)</td><td.+?>.+?</td><td.+?>(.+?)</td>"')
. keep if !mi(iso2,name_hi)
. keep iso2 name_hi
. list

Comment