Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

absolutUrl has null character at end of string and debugging using Mono

Discussion in 'Documentation' started by ZeN12, Aug 20, 2015.

  1. ZeN12

    ZeN12

    Joined:
    Mar 5, 2013
    Posts:
    10
    The docs. about absolutUrl (http://docs.unity3d.com/ScriptReference/Application-absoluteURL.html) isn't full, please specify that at the end there is a end of string (On WebGL).

    That may cause some problems (I had), when you try to read a file (in my case was configs) in same "url position".

    About debugging using Mono, please specify that debugging won't work if there is installed multiple versions of Unity (in my case Unity 5.0 and Unity 5.1).
     
  2. duck

    duck

    Unity Technologies

    Joined:
    Oct 21, 2008
    Posts:
    358
    Hi ZeN12,

    Thanks for the feedback, I'm looking into this.
     
  3. duck

    duck

    Unity Technologies

    Joined:
    Oct 21, 2008
    Posts:
    358
    Confirmed, in WebGL you currently get a stray \0 (ascii zero) character on the end of the string which can mess things up in more ways than one. This is a bug, so it wouldn't really be correct to document this behaviour as it is not intended.

    I would suggest until we release a fix, you should add code for detecting and removing this character before processing the string as normal. For example:

    Code (CSharp):
    1. string url = Application.absoluteURL;
    2. url = url.Replace(((char)0).ToString(),"");