nxdk icon indicating copy to clipboard operation
nxdk copied to clipboard

Lack of wprintf in xlibc makes unicode string debug diffcult

Open Fisherman166 opened this issue 7 years ago • 1 comments

I am unsure if this should go in the blanket xlibc issue or have its own. Let me know if this should go in the blanket issue.

I'm working on making the unicode string tests in the xbox_kernel_test_suite better and not being able to print unicode strings with printf makes the debug difficult. wprintf does not exist, and '%ls' is not a valid format string for printf. I did some research today to see how I could possibly implement this functionality, but glibc's implementation of printf is confusing so I didn't make much progress.

My workaround solution has been to print the hex value of each WCHAR character. It works but it isn't the most pretty.

Fisherman166 avatar Nov 13 '18 03:11 Fisherman166

This is an upstream issue in https://github.com/DevSolar/pdclib now (not tracked via GitHub issues).

You should be able to use RtlUnicodeStringToAnsiString and others as a temporary workaround.

For just debug output, a valid workaround is probably to just export to a file in binary mode (which preserves any encoding).

JayFoxRox avatar May 17 '19 05:05 JayFoxRox