Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. string Int2Uni(integer i)
  2. // Totally works with mono. Does NOT work with LSLeditor.
  3. // Can't be 0. Should be in UTF-16 range. No error checking.
  4. // Only works in the 0x0001 thru 0xD7FF range (UTF-16 compatibility).
  5. {
  6. if (i < 0x80) return llUnescapeURL("%" + Byte2Hex(i));
  7. if (i < 0x800) return llUnescapeURL("%" + Byte2Hex((i >> 6) | 0x3FC0) + "%" + Byte2Hex((i | 0x80) & 0xBF));
  8. return llUnescapeURL("%" + Byte2Hex((i >> 12) | 0x1FE0) + "%" + Byte2Hex(((i >> 6 ) | 0x80) & 0xBF) + "%" + Byte2Hex(((i | 0x80) & 0xBF)));
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement