1
0

utilities.cpp 418 B

12345678910111213141516171819
  1. #include "main.h"
  2. int NXURICreateWithUTF16(nx_uri_t *out, const wchar_t *utf16)
  3. {
  4. nx_string_t nx_filename = 0;
  5. nx_uri_t uri_filename = 0;
  6. int ret = NXStringCreateWithUTF16(&nx_filename, utf16);
  7. if (ret != NErr_Success)
  8. return ret;
  9. ret = NXURICreateWithNXString(&uri_filename, nx_filename);
  10. NXStringRelease(nx_filename);
  11. if (ret != NErr_Success)
  12. return ret;
  13. *out = uri_filename;
  14. return NErr_Success;
  15. }