I have files encoded in Shift_JIS, that mainly contains JSP source
code (ascii), but sometimes also contains strings that are non-ascii
(japanese words).
So, I would like to know if there is a way with ruby to :
- detect files containing something else than ascii,
- extract the non-ascii strings thare were found.
Thank you !
Any character that has the top bit clear is potentially valid ascii,
though if you take away the non printing characters there’s an
additional exlusion set.
According to Shift JIS - Wikipedia
Testing for character codes with the top bit set should indicate
either katakana or double byte characters. See the chart there for
which ranges are double byte, which are single and which are not legal.
RF