fix(libc): format guest wide strings in swprintf as 16-bit units #1511

Merged
cubersu merged 1 commit from upstream-pr/1511 into main 2026-10-10 06:26:16 +00:00
cubersu commented 2026-10-08 10:41:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cubersu on 2026-10-08T10:41:35Z.


What

swprintf passed guest strings to the host's vswprintf. The guest's wchar_t is 16 bits, so on Linux (32-bit host wchar_t) it misread the format and miswrote the output.

  • swprintf moves to FormattingWide.cpp and forwards to the guest vswprintf (FormatWide), on Linux and Windows alike. The Windows-only WindowsWideFormatting.hpp had no other user and is removed.
  • swprintf is dropped from the Wide-character conversions entry. The entry still names wcsrtombs only because that is its state on main; #1507 removes it. Both PRs edit that one line toward the same end state (no host passthrough left), so whichever merges second rebases it to the wcsto* note alone.
  • The padded, exact-fit and invalid-conversion checks from #1512 are included (credited in the commit), so this PR covers both test sets and #1512 can be closed as a duplicate.

The wcsrtombs part was removed after the conflict report, since #1507 (opened earlier) implements it; this branch's former wcsrtombs tests pass against #1507.

Tested

Linux (Ubuntu 24.04, GCC 13.3), rebased on current main. The swprintf checks in guest_wide_formatting (non-ASCII and surrogate-pair output, padding, truncation, exact fit, terminator that does not fit, invalid conversion, empty format, null buffer, zero size) fail on main and pass with this change. libs target builds; guest_wide_formatting, guest_wide_strings, guest_strings, guest_wcsrtombs_s pass. Windows: built and tested by @popcoder565 in the comments above (on the earlier revision, whose swprintf code is unchanged). tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions (#1512 is the same change; its extra tests are merged here)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01ULF8vCbJFyzxVsW3SfiWC5

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4785517645 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511). Originally posted by [cubersu](https://github.com/cubersu) on 2026-10-08T10:41:35Z. --- ### What `swprintf` passed guest strings to the host's `vswprintf`. The guest's `wchar_t` is 16 bits, so on Linux (32-bit host `wchar_t`) it misread the format and miswrote the output. - `swprintf` moves to [FormattingWide.cpp](core/libs/prx/libc/src/FormattingWide.cpp) and forwards to the guest `vswprintf` (`FormatWide`), on Linux and Windows alike. The Windows-only `WindowsWideFormatting.hpp` had no other user and is removed. - `swprintf` is dropped from the [Wide-character conversions](docs/dev/TechnicalDebt.md) entry. The entry still names `wcsrtombs` only because that is its state on `main`; #1507 removes it. Both PRs edit that one line toward the same end state (no host passthrough left), so whichever merges second rebases it to the `wcsto*` note alone. - The padded, exact-fit and invalid-conversion checks from #1512 are included (credited in the commit), so this PR covers both test sets and #1512 can be closed as a duplicate. The `wcsrtombs` part was removed after the conflict report, since #1507 (opened earlier) implements it; this branch's former `wcsrtombs` tests pass against #1507. ### Tested Linux (Ubuntu 24.04, GCC 13.3), rebased on current `main`. The `swprintf` checks in `guest_wide_formatting` (non-ASCII and surrogate-pair output, padding, truncation, exact fit, terminator that does not fit, invalid conversion, empty format, null buffer, zero size) fail on `main` and pass with this change. `libs` target builds; `guest_wide_formatting`, `guest_wide_strings`, `guest_strings`, `guest_wcsrtombs_s` pass. Windows: built and tested by @popcoder565 in the comments above (on the earlier revision, whose `swprintf` code is unchanged). `tools/check_conventions.py --base origin/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#1512 is the same change; its extra tests are merged here) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ULF8vCbJFyzxVsW3SfiWC5
klosixgaming-arch commented 2026-10-08 10:54:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T10:54:45Z.

Review: COMMENTED


Comprehensive fix for both swprintf and wcsrtombs to properly handle 16-bit guest characters. The new test coverage is excellent, especially the surrogate pair handling in swprintf tests.

Note: This PR overlaps significantly with #1512 - both address the same wide-character formatting issues. They should probably be coordinated so only one merges (or they're combined). The TechnicalDebt.md line will need rebasing whichever goes second.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5455472018 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#pullrequestreview-5455472018). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T10:54:45Z. **Review:** COMMENTED --- Comprehensive fix for both swprintf and wcsrtombs to properly handle 16-bit guest characters. The new test coverage is excellent, especially the surrogate pair handling in swprintf tests. Note: This PR overlaps significantly with #1512 - both address the same wide-character formatting issues. They should probably be coordinated so only one merges (or they're combined). The TechnicalDebt.md line will need rebasing whichever goes second.
popcoder565 commented 2026-10-08 11:09:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-08T11:09:23Z.


Tested on Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Intel Core i7-12700H, merged onto main 084aeeb6.

  • It builds.
  • guest_wide_formatting, guest_wcsrtombs and guest_wcsrtombs_s: 5 of 5 runs pass.
  • Mutation check: I put Formatting.cpp, FormattingWide.cpp, Multibyte.cpp, Strings.cpp and the deleted WindowsWideFormatting.hpp back to main and kept the new tests. guest_wide_formatting and guest_wcsrtombs then abort in 2 of 2 runs, so the new checks catch it on Windows too.
  • Full ctest: 436 of 438 pass. agc_driver_dcc_keys_first_write and agc_driver_srgb8_color_target failed. Both are the NVIDIA import flakes in #1434.

Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6058555015 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6058555015). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-08T11:09:23Z. --- Tested on Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Intel Core i7-12700H, merged onto `main` 084aeeb6. - It builds. - `guest_wide_formatting`, `guest_wcsrtombs` and `guest_wcsrtombs_s`: 5 of 5 runs pass. - Mutation check: I put `Formatting.cpp`, `FormattingWide.cpp`, `Multibyte.cpp`, `Strings.cpp` and the deleted `WindowsWideFormatting.hpp` back to `main` and kept the new tests. `guest_wide_formatting` and `guest_wcsrtombs` then abort in 2 of 2 runs, so the new checks catch it on Windows too. - Full ctest: 436 of 438 pass. `agc_driver_dcc_keys_first_write` and `agc_driver_srgb8_color_target` failed. Both are the NVIDIA import flakes in #1434. Tested with AI assistance (Claude Code).
klosixgaming-arch commented 2026-10-08 11:25:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:25:33Z.

Review: APPROVED


Good fix for swprintf formatting consistency across platforms. This simplifies the codebase by removing the separate Windows-specific implementation and routing through the 16-bit guest formatter on both hosts.

Strengths:

  • Clean simplification that eliminates duplicate code paths
  • Proper handling of UTF-8 %s arguments (decoded as in vswprintf)
  • Comprehensive test coverage including edge cases (truncation, padding, invalid conversions, zero size, null buffer)
  • Good documentation update removing swprintf from TechnicalDebt.md

Technical notes:

  • The approach of routing through vswprintf_nid_postfix ensures consistent behavior between the two functions
  • Proper error handling for invalid conversions and truncated output
  • Test cases properly verify both success and failure conditions including surrogate pairs and non-ASCII characters

This will improve compatibility with titles that use swprintf. Ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5455813549 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#pullrequestreview-5455813549). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:25:33Z. **Review:** APPROVED --- Good fix for swprintf formatting consistency across platforms. This simplifies the codebase by removing the separate Windows-specific implementation and routing through the 16-bit guest formatter on both hosts. **Strengths:** - Clean simplification that eliminates duplicate code paths - Proper handling of UTF-8 %s arguments (decoded as in vswprintf) - Comprehensive test coverage including edge cases (truncation, padding, invalid conversions, zero size, null buffer) - Good documentation update removing swprintf from TechnicalDebt.md **Technical notes:** - The approach of routing through vswprintf_nid_postfix ensures consistent behavior between the two functions - Proper error handling for invalid conversions and truncated output - Test cases properly verify both success and failure conditions including surrogate pairs and non-ASCII characters This will improve compatibility with titles that use swprintf. Ready to merge.
Dextroid17 commented 2026-10-08 13:19:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T13:19:17Z.


The overlap bot already pairs this with #1512 (same export swprintf_nid_postfix, same four files), and the two were opened 17 seconds apart (10:41:35 vs 10:41:52). Rather than let a maintainer arbitrate which to keep, here is what each side has, so you two can collapse them without losing anything:

#1511 (this one)

  • Independent run, Windows 10 / MinGW GCC 15.2.0: builds; guest_wide_formatting, guest_wcsrtombs and guest_wcsrtombs_s 5/5; mutation check (implementation reverted, tests kept) aborts, so the tests bite; full ctest 436/438, the two failures being the NVIDIA import flakes in #1434.
  • Title also claims the wcsrtombs half, but the diff touches no wcsrtombs code — if that half is meant to be here it is missing; if it is #1507, a Depends on: line would say so.
  • Currently CONFLICTING.

#1512

  • No independent run yet, but it is the one that currently merges cleanly.
  • Its test set is not a subset of yours: it covers padding (%5ls, %-3c, %lc with a non-ASCII value) and an exact-fit case (swprintf(buf, 5, "%ls", "abcd") == 4), where yours covers the non-ASCII and truncation paths (%d-%ls, the surrogate pair, the terminator-not-fitting case).

So the useful move is probably: keep one PR open, pull the other's test cases into it (that is the only real difference), and have the second author withdraw or convert their PR into a comment. That keeps both sets of coverage and leaves the maintainer one thing to review instead of two.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060766727 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6060766727). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T13:19:17Z. --- The overlap bot already pairs this with #1512 (same export `swprintf_nid_postfix`, same four files), and the two were opened **17 seconds apart** (10:41:35 vs 10:41:52). Rather than let a maintainer arbitrate which to keep, here is what each side has, so you two can collapse them without losing anything: **#1511 (this one)** - Independent run, Windows 10 / MinGW GCC 15.2.0: builds; `guest_wide_formatting`, `guest_wcsrtombs` and `guest_wcsrtombs_s` 5/5; **mutation check** (implementation reverted, tests kept) aborts, so the tests bite; full ctest 436/438, the two failures being the NVIDIA import flakes in #1434. - Title also claims the `wcsrtombs` half, but the diff touches no `wcsrtombs` code — if that half is meant to be here it is missing; if it is #1507, a `Depends on:` line would say so. - Currently `CONFLICTING`. **#1512** - No independent run yet, but it is the one that currently merges cleanly. - Its test set is not a subset of yours: it covers padding (`%5ls`, `%-3c`, `%lc` with a non-ASCII value) and an exact-fit case (`swprintf(buf, 5, "%ls", "abcd") == 4`), where yours covers the non-ASCII and truncation paths (`%d-%ls`, the surrogate pair, the terminator-not-fitting case). So the useful move is probably: keep one PR open, pull the other's *test cases* into it (that is the only real difference), and have the second author withdraw or convert their PR into a comment. That keeps both sets of coverage and leaves the maintainer one thing to review instead of two. Written with AI assistance.
Dextroid17 commented 2026-10-08 13:37:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T13:37:57Z.


Following the body rewrite, three things that need to line up before this is reviewable — all of them cheap to fix.

1. The description describes a half that is not in the diff. The new body says wcsrtombs moves to Multibyte.cpp and converts through wcrtomb following C11 7.29.6.4.1, and the Tested section says the new guest_wcsrtombs test fails on main and passes with this change. But this PR's files are:

core/libs/prx/libc/include/WindowsWideFormatting.hpp   +0/-99
core/libs/prx/libc/src/Formatting.cpp                  +0/-16
core/libs/prx/libc/src/FormattingWide.cpp              +7/-0
core/libs/tests/GuestWideFormatting.cpp               +26/-0
docs/dev/TechnicalDebt.md                              +1/-1

No Multibyte.cpp, no Strings.cpp, and core/libs/tests/GuestWcsrtombs.cpp is #1507's new file, not part of this PR. So either the push did not carry that half, or the body was written against a local branch that also had #1507 in it. Either way, the honest options are: push the missing half, or trim the body to what the diff does and add Depends on: #1507 for the other half. (The same shape — numbers taken from a combined branch — is why #1294 was closed; worth avoiding.)

2. Your debt entry and #1507's edit the same line in opposite directions. This PR now leaves it saying "wcsrtombs still passes guest strings to the host's wchar_t function"; #1507 rewrites the same entry to say wcsrtombs goes through wcrtomb and is no longer a host passthrough. Whichever merges second overwrites the other. Since #1507 is the one that implements it, the entry probably wants your version only if the wcsrtombs half is not in this PR — which is point 1.

3. On the #1512 overlap from my previous comment: the useful split is the test cases, not the code. Theirs adds padding (%5ls, %-3c, %lc with a non-ASCII value) and an exact-fit case; yours adds the non-ASCII and truncation paths. Porting the other set's cases and letting one PR withdraw keeps all the coverage and leaves the maintainer one thing to review.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6061111985 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6061111985). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T13:37:57Z. --- Following the body rewrite, three things that need to line up before this is reviewable — all of them cheap to fix. **1. The description describes a half that is not in the diff.** The new body says `wcsrtombs` moves to `Multibyte.cpp` and converts through `wcrtomb` following C11 7.29.6.4.1, and the `Tested` section says the new `guest_wcsrtombs` test fails on `main` and passes with this change. But this PR's files are: ``` core/libs/prx/libc/include/WindowsWideFormatting.hpp +0/-99 core/libs/prx/libc/src/Formatting.cpp +0/-16 core/libs/prx/libc/src/FormattingWide.cpp +7/-0 core/libs/tests/GuestWideFormatting.cpp +26/-0 docs/dev/TechnicalDebt.md +1/-1 ``` No `Multibyte.cpp`, no `Strings.cpp`, and `core/libs/tests/GuestWcsrtombs.cpp` is **#1507's** new file, not part of this PR. So either the push did not carry that half, or the body was written against a local branch that also had #1507 in it. Either way, the honest options are: push the missing half, or trim the body to what the diff does and add `Depends on: #1507` for the other half. (The same shape — numbers taken from a combined branch — is why #1294 was closed; worth avoiding.) **2. Your debt entry and #1507's edit the same line in opposite directions.** This PR now leaves it saying *"`wcsrtombs` still passes guest strings to the host's `wchar_t` function"*; #1507 rewrites the same entry to say `wcsrtombs` goes through `wcrtomb` and is no longer a host passthrough. Whichever merges second overwrites the other. Since #1507 is the one that implements it, the entry probably wants your version only if the wcsrtombs half is not in this PR — which is point 1. **3. On the #1512 overlap** from my previous comment: the useful split is the test cases, not the code. Theirs adds padding (`%5ls`, `%-3c`, `%lc` with a non-ASCII value) and an exact-fit case; yours adds the non-ASCII and truncation paths. Porting the other set's cases and letting one PR withdraw keeps all the coverage and leaves the maintainer one thing to review. Written with AI assistance.
cubersu commented 2026-10-08 13:56:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cubersu on 2026-10-08T13:56:01Z.


Thanks @Dextroid17, all three are addressed:

  1. The body now matches the diff: this PR is swprintf only. The wcsrtombs half was dropped in favour of #1507, which was opened first; the old body was written before that split.
  2. The debt line: on main the entry names both functions. This PR removes swprintf, #1507 removes wcsrtombs, so the two edits head to the same end state (only the wcsto* note remains). Whichever merges second needs a one-line rebase, and I'll do it on this side if #1507 goes first.
  3. #1512's padded, exact-fit and invalid-conversion checks are ported in, with @Noface07 credited as co-author, so this PR now carries both test sets.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6061451794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6061451794). Originally posted by [cubersu](https://github.com/cubersu) on 2026-10-08T13:56:01Z. --- Thanks @Dextroid17, all three are addressed: 1. The body now matches the diff: this PR is `swprintf` only. The `wcsrtombs` half was dropped in favour of #1507, which was opened first; the old body was written before that split. 2. The debt line: on `main` the entry names both functions. This PR removes `swprintf`, #1507 removes `wcsrtombs`, so the two edits head to the same end state (only the `wcsto*` note remains). Whichever merges second needs a one-line rebase, and I'll do it on this side if #1507 goes first. 3. #1512's padded, exact-fit and invalid-conversion checks are ported in, with @Noface07 credited as co-author, so this PR now carries both test sets.
Dextroid17 commented 2026-10-08 14:16:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T14:16:53Z.


All three check out on the current head — thanks for the fast turnaround.

1. Body now matches the diff. The file list is swprintf-only:

core/libs/prx/libc/include/WindowsWideFormatting.hpp   +0/-99
core/libs/prx/libc/src/Formatting.cpp                  +0/-16
core/libs/prx/libc/src/FormattingWide.cpp               +7/-0
core/libs/tests/GuestWideFormatting.cpp                +26/-0
docs/dev/TechnicalDebt.md                               +1/-1

No Multibyte.cpp / Strings.cpp, and the swprintf forwarder now sits beside vswprintf_nid_postfix in FormattingWide.cpp, so the body describes what the diff does.

2. The debt line read is right. This PR drops swprintf from the entry and leaves wcsrtombs (its main state); #1507 drops wcsrtombs. Both edits head to the same end state, so whichever merges second rebases the one line — your offer to do it on this side if #1507 goes first is exactly what is needed.

3. #1512's checks are in. CheckSwprintf carries the padded case (%5ls|%-3c|%lc → wide|z |€), the exact-fit case (swprintf(buf, 5, "%ls", "abcd") == 4), and the invalid-conversion case (%q) alongside the non-ASCII/truncation/surrogate paths you already had, and the commit credits @Noface07 as co-author. Verified from the diff.

Two things for the record, neither a blocker:

  • #1512 is still open (@Noface07), so "close as duplicate" is theirs or the maintainer's call — this PR covering both test sets does not settle it by itself.
  • No checks have run on this head (no checks reported on the branch), so a green CI is not there yet; a maintainer needs to approve the workflow run, which is @boykopovar's repo-write.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6061851760 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6061851760). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T14:16:53Z. --- All three check out on the current head — thanks for the fast turnaround. **1. Body now matches the diff.** The file list is `swprintf`-only: ``` core/libs/prx/libc/include/WindowsWideFormatting.hpp +0/-99 core/libs/prx/libc/src/Formatting.cpp +0/-16 core/libs/prx/libc/src/FormattingWide.cpp +7/-0 core/libs/tests/GuestWideFormatting.cpp +26/-0 docs/dev/TechnicalDebt.md +1/-1 ``` No `Multibyte.cpp` / `Strings.cpp`, and the `swprintf` forwarder now sits beside `vswprintf_nid_postfix` in `FormattingWide.cpp`, so the body describes what the diff does. **2. The debt line read is right.** This PR drops `swprintf` from the entry and leaves `wcsrtombs` (its `main` state); #1507 drops `wcsrtombs`. Both edits head to the same end state, so whichever merges second rebases the one line — your offer to do it on this side if #1507 goes first is exactly what is needed. **3. #1512's checks are in.** `CheckSwprintf` carries the padded case (`%5ls|%-3c|%lc` → ` wide|z |€`), the exact-fit case (`swprintf(buf, 5, "%ls", "abcd") == 4`), and the invalid-conversion case (`%q`) alongside the non-ASCII/truncation/surrogate paths you already had, and the commit credits @Noface07 as co-author. Verified from the diff. Two things for the record, neither a blocker: - **#1512 is still open** (@Noface07), so "close as duplicate" is theirs or the maintainer's call — this PR covering both test sets does not settle it by itself. - **No checks have run on this head** (`no checks reported on the branch`), so a green CI is not there yet; a maintainer needs to approve the workflow run, which is @boykopovar's repo-write. Written with AI assistance.
Noface07 commented 2026-10-08 15:21:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Noface07 on 2026-10-08T15:21:59Z.


Thanks @cubersu for the co-author credit. Amazing how our PR's were only 17 secs apart.

I'm closing #1512 in favour of this one.

Thanks everybody @klosixgaming-arch @Dextroid17 @popcoder565 .

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6063152344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6063152344). Originally posted by [Noface07](https://github.com/Noface07) on 2026-10-08T15:21:59Z. --- Thanks @cubersu for the co-author credit. Amazing how our PR's were only 17 secs apart. I'm closing #1512 in favour of this one. Thanks everybody @klosixgaming-arch @Dextroid17 @popcoder565 .
Dextroid17 commented 2026-10-08 21:59:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T21:59:49Z.


Confirmed from my side — all three hold, and I checked the two halves of the split against both diffs.

  • The debt line really is shared: this PR's hunk keeps wcsrtombs and drops swprintf, while #1507's hunk keeps swprintf and drops wcsrtombs (re-pointing the entry at Multibyte.cpp). The two PRs rewrite the same line in opposite directions, so the one-line rebase for whichever merges second is a real requirement, not a precaution.
  • The body now matches the diff: swprintf only, with the wcsrtombs half left to #1507, which was opened first.
  • #1512's padded, exact-fit and invalid-conversion cases are carried here, with @Noface07 credited.

No open point from my earlier review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069853449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6069853449). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T21:59:49Z. --- Confirmed from my side — all three hold, and I checked the two halves of the split against both diffs. - The debt line really is shared: this PR's hunk keeps `wcsrtombs` and drops `swprintf`, while #1507's hunk keeps `swprintf` and drops `wcsrtombs` (re-pointing the entry at `Multibyte.cpp`). The two PRs rewrite the same line in opposite directions, so the one-line rebase for whichever merges second is a real requirement, not a precaution. - The body now matches the diff: `swprintf` only, with the `wcsrtombs` half left to #1507, which was opened first. - #1512's padded, exact-fit and invalid-conversion cases are carried here, with @Noface07 credited. No open point from my earlier review.
ArjenS-LA commented 2026-10-09 02:44:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-09T02:44:30Z.


Sorry for my slow response. If #1511 merges first, I’ll rebase #1507 and reconcile the shared debt entry to reflect both fixes while preserving the remaining limitations. Thanks for the coordination 👍

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6073189923 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6073189923). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-09T02:44:30Z. --- Sorry for my slow response. If \#1511 merges first, I’ll rebase \#1507 and reconcile the shared debt entry to reflect both fixes while preserving the remaining limitations. Thanks for the coordination 👍
Dextroid17 commented 2026-10-09 11:18:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T11:18:27Z.


Agreed, and nothing is waiting on you: whichever of #1507 and #1511 lands first, the other rebases and reconciles the shared debt entry so the remaining limitations are described once rather than twice. Merge order is the maintainers' call rather than ours, so there is nothing for us to decide — the plan you describe is the one I would have proposed.

Thanks for picking it up rather than leaving both entries to drift.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079814264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6079814264). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T11:18:27Z. --- Agreed, and nothing is waiting on you: whichever of #1507 and #1511 lands first, the other rebases and reconciles the shared debt entry so the remaining limitations are described once rather than twice. Merge order is the maintainers' call rather than ours, so there is nothing for us to decide — the plan you describe is the one I would have proposed. Thanks for picking it up rather than leaving both entries to drift. Written with AI assistance.
oneandonlydean commented 2026-10-10 03:18:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:18:43Z.


This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6093230601 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6093230601). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T03:18:43Z. --- This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
adriadam10 commented 2026-10-10 06:19:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:19:28Z.


Rebased onto current main: the only conflict was the "Wide-character conversions" line in TechnicalDebt now that #1507 is merged. The entry now keeps the wcsto* and wcsrtombs notes and no longer mentions swprintf. No code changes.

Checked on Linux after the rebase: guest_wide_formatting, guest_wide_strings, guest_wcsrtombs, guest_wcsrtombs_s pass. Windows run by @popcoder565 above (same swprintf code), and @oneandonlydean's testing; merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094588405 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1511#issuecomment-6094588405). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T06:19:28Z. --- Rebased onto current `main`: the only conflict was the "Wide-character conversions" line in TechnicalDebt now that #1507 is merged. The entry now keeps the `wcsto*` and `wcsrtombs` notes and no longer mentions `swprintf`. No code changes. Checked on Linux after the rebase: `guest_wide_formatting`, `guest_wide_strings`, `guest_wcsrtombs`, `guest_wcsrtombs_s` pass. Windows run by @popcoder565 above (same `swprintf` code), and @oneandonlydean's testing; merging once CI is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1511
No description provided.