Last active
August 29, 2015 14:22
-
-
Save DanPuzey/c03e369eb7090808ca9c to your computer and use it in GitHub Desktop.
Random snippet of .cs that is broken in my Unity project (but works in a clean project)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string s = "RHUBARB" + "æ" + "CUSTARD"; | |
var c = s[7]; | |
var i = (int)c; | |
Debug.Log(c); // expect æ in console | |
Debug.Log(i); // expect 230 in console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, in a clean project, the code above works as expected. In a larger project (with a bunch of other code), the console output is a question mark in a black diamond, and the number
65533
. What could be the cause of this?Worth noting that this has only become an issue since upgrading Unity3d to 4.6.5f1 (works fine in 4.6.1f1), but it's also only an issue in our big project (not in a clean project).