mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Enhancement
- Modified leftJustify and rightJustify to handle UTF8.
This commit is contained in:
parent
937f2d9c8f
commit
66afc7c057
2 changed files with 5 additions and 3 deletions
|
@ -728,7 +728,7 @@ std::string leftJustify (const int input, const int width)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string leftJustify (const std::string& input, const int width)
|
||||
{
|
||||
return input + std::string (width - input.length (), ' ');
|
||||
return input + std::string (width - characters (input), ' ');
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -742,7 +742,7 @@ std::string rightJustify (const int input, const int width)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string rightJustify (const std::string& input, const int width)
|
||||
{
|
||||
return std::string (width - input.length (), ' ') + input;
|
||||
return std::string (width - characters (input), ' ') + input;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue