This is an interview question:
Return true or false for a given string value and its corresponding unicode
public boolean decode (String value, String unicode){
// logic goes here
}
for eg if the given inputs are
String value = "abc" String unicode = "UTF-8" return value is false
String value"\u00A3" String unicode = "ASCII" return value is true
I read in an article that the unicode values are determined internally by bytes. So my first logic was trying to get the range ie for eg if it belongs to range between 40 and 63 its ASCII. Please correct if am wrong with this logic and if there is a better way to find out the unicode.