1

So my program requires me to test for the greek letter delta. I've found the unicode value \u0394 that translates to δ. But the statement does not run, meaning it does not read the delta. Here getXunit returns the String value of the Unit, which should be delta, but when printed it returns ?.

if(getSpectrum().getXUnit().equals("\u03B4"){
  //do stuff
}

How would I accomplish this?

Kara
  • 6,115
  • 16
  • 50
  • 57
bforcer
  • 147
  • 3
  • 13
  • 3
    What do you mean "does not work"? Does it crash? Does it just fail to detect equals? Does it set fire to your living room furniture? – arcy Aug 19 '13 at 20:18
  • 1
    What are `getSpectrum()` and `getXUnit()`? Most importantly, what is the return type of `getXUnit()`? – kiheru Aug 19 '13 at 20:19
  • getXUnit returns a String. And does not work, means it does not detect the delta in the XUnit. When I print XUnit, it returns ?, when I can see the delta on the spectrum. – bforcer Aug 19 '13 at 20:30
  • 1
    Unless `getXunit()` returns a string containing the single character `\u0394` this code won't work. – Jim Garrison Aug 19 '13 at 20:34
  • 1
    Small delta is 03*B*4. Also there's a delta in the latin area, 1E9F. 0394 would be capital delta, but you supposedly were not looking for that. – kiheru Aug 19 '13 at 20:35
  • 1
    One thing you could check, is the unicode value of the particular delta you need, using the tricks here: http://stackoverflow.com/questions/2220366/get-unicode-value-of-a-character . Another possible problem source is if the file (?) you get the data from is read using a wrong encoding. – kiheru Aug 19 '13 at 20:51

0 Answers0