| Summary: | [Patch] Pass NSString to NSLog() | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Hiroyuki Iwatsuki <don> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | macOS 10.15 | ||
| Attachments: | Fix to pass NSString to NSLog(). | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/c47106665724 |
Created attachment 4746 [details] Fix to pass NSString to NSLog(). If you pass the C string directly to NSLog(), it will be garbled with Japanese and probably other language strings, or no log will be output at all. NSLog("Hello, World!"); // => "Hello, World!" NSLog("こんにちは、世界!"); // => No output... Therefore, you need to convert the string to an NSString before passing it to NSLog(). NSString *str = [NSString stringWithUTF8String:"こんにちは、世界!"]; NSLog(@"%@", str); // => "こんにちは、世界!" Thank you.