<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/131107>131107</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
wcin >> buffer error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
debugee
</td>
</tr>
</table>
<pre>
sample
debug config
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/build/testcpp",
"args": [],
"cwd": "${workspaceFolder}",
"initCommands": [
"settings set target.process.thread.step-avoid-regexp \"\"",
],
"console": "integratedTerminal",
"env": {
"LANG":"en_US.UTF-8"
}
}
]
}
please add "LANG":"en_US.UTF-8"
<img width="714" alt="Image" src="https://github.com/user-attachments/assets/2870f4bd-9fe4-46d7-9b07-0ec0469efeb8" />
in file locale.cpp
codecvt<wchar_t, char, mbstate_t>::result codecvt<wchar_t, char, mbstate_t>::do_in(
have bug when trans utf-8 to wchar_t
when input 你123
do_in trans uncompleted utf-8 bytes with first byte 0xe4
and return ok, but correct is partial
so bug come out
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVVGP2zYM_jXKCxFDke1z8uAH36XZChR7aft8kCXaVitLnkQn7b8fZCe7tLvrNiCILerjx08UScsYTe8Qa1Y-svK4kTMNPtQa27lH3LRef68Zb6IcJ4uMN4w3yx4o7zrTw2qycnZqyL5E75KhemS8AQBg4sTECT5HhPeO0FrzEV1EIA8WZXAgWz8TTD5G01oESRRMOxPG7EeG3_0ZQ3I7G7yAxqiCmch4F8F3gN9MJOP6t_1PPsDoA4JxnQ-jTK5MPMHZREMsb2AgmiLLmxXf-2w0KvjoO8qUH5k4dRdr3Ne0nZ_Sm9EsP-5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