I was trying to fix some weird PDF Unicode remapping issues when I was stuck by this issue where adding an ENQ Unicode character to some part of the code prevents you from compiling the code and IDE will present you with what I think is a false alarm(error).
Consider this example of completely valid Kotlin code and let's call it Program A where unfortunately you can't see the actual characters here between apostrophes but believe me there's a character in there (if you copy this code into your IDE you can see those characters).
package yamin
fun main() {
val foo = mutableListOf('')
//val bar = mutableListOf('')
println(foo)
}
However, you can see them in the picture.
But if you decide to compile this code somehow IDE fails to compile it and claims that there are 'Too many characters in a character literal' in line 4.
What is interesting is that the sheer presence of ENQ character even in a comment line prevents the IDE to compile this code and if you remove line 5, therefore, removing the presence of ENQ character then you can compile this code (let's call it Program B), observe:
Anyway if you decide to remove line 4 in Program A and uncomment line 5 then you can compile that code too (let's call it Program C).
So let's recap Program A is invalid and line 4 is the culprit of the invalidity but removing line 5 in that program which leaves us with Program B could be compiled successfully and this situation is repeated for Program C.
What am I missing here?