mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 02:25:34 -04:00
fixes required by review of pr1700
This commit is contained in:
parent
5223ff751a
commit
7aa51423a4
13 changed files with 98 additions and 154 deletions
|
@ -205,6 +205,19 @@ bool ConvertUtf16ToUtf8(const std::wstring& source, std::string& dest)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool is_alphanumeric(char c)
|
||||
{
|
||||
return (c>='0' && c<'9') || (c>='a' && c<='z') || (c>='A' && c<='Z') ;
|
||||
}
|
||||
|
||||
bool is_alphanumeric(const std::string& s)
|
||||
{
|
||||
for(uint32_t i=0;i<s.size();++i)
|
||||
if(!is_alphanumeric(s[i]))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
} } // librs::util
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
|
|
|
@ -25,10 +25,14 @@
|
|||
#include <string>
|
||||
#include <stdarg.h>
|
||||
|
||||
namespace librs { namespace util {
|
||||
namespace librs {
|
||||
namespace util {
|
||||
|
||||
bool ConvertUtf8ToUtf16(const std::string& source, std::wstring& dest);
|
||||
bool ConvertUtf16ToUtf8(const std::wstring& source, std::string& dest);
|
||||
bool ConvertUtf8ToUtf16(const std::string& source, std::wstring& dest);
|
||||
bool ConvertUtf16ToUtf8(const std::wstring& source, std::string& dest);
|
||||
|
||||
bool is_alphanumeric(char c) ;
|
||||
bool is_alphanumeric(const std::string& s);
|
||||
|
||||
} } // librs::util
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue