mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Properly standardize RFC1751 inputs
This commit is contained in:
committed by
Vinnie Falco
parent
06d6e4901e
commit
044f390fe0
@@ -336,28 +336,16 @@ void RFC1751::insert (char* s, int x, int start, int length)
|
||||
|
||||
void RFC1751::standard (std::string& strWord)
|
||||
{
|
||||
BOOST_FOREACH (char cLetter, strWord)
|
||||
for (auto& letter : strWord)
|
||||
{
|
||||
if (!isascii (cLetter))
|
||||
{
|
||||
; // nothing
|
||||
}
|
||||
else if (islower (cLetter))
|
||||
{
|
||||
cLetter = toupper (cLetter);
|
||||
}
|
||||
else if (cLetter == '1')
|
||||
{
|
||||
cLetter = 'L';
|
||||
}
|
||||
else if (cLetter == '0')
|
||||
{
|
||||
cLetter = 'O';
|
||||
}
|
||||
else if (cLetter == '5')
|
||||
{
|
||||
cLetter = 'S';
|
||||
}
|
||||
if (islower (letter))
|
||||
letter = toupper (letter);
|
||||
else if (letter == '1')
|
||||
letter = 'L';
|
||||
else if (letter == '0')
|
||||
letter = 'O';
|
||||
else if (letter == '5')
|
||||
letter = 'S';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user