Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Surprising that there is no direct library function for this! Did some quick Googling and found this StackOverflow, but couldn't find any single API that would return the size of a UTF-8 string.
Looks ok, personally, I'd try to do this without pointers but it probably doesn't matter.
Can this function be called from multiple threads?
services/backup/src/Tools.cpp | ||
---|---|---|
60 | Before this while in https://en.cppreference.com/w/cpp/string/multibyte/mblen there's a line std::mblen(nullptr, 0); // reset the conversion state. Should we include it? | |
63 | What is strlen_mb() in this error message? Could you modify the message so that it is more helpful? |
It seems to me that this diff should be abandoned since it's replaced in D4544. It's important that you think in terms of diffs going forward... when you fix an issue introduced in an earlier diff, you should always update the existing diff instead of introducing a new one.
Think about it from the perspective of the reviewer. What is the point of reviewing this code if it's going to immediately be thrown away anyways?