Skip to content

Instantly share code, notes, and snippets.

@DanPuzey
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanPuzey/c03e369eb7090808ca9c to your computer and use it in GitHub Desktop.
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)
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
@DanPuzey
Copy link
Author

DanPuzey commented Jun 2, 2015

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment