Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
irods-microservices
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM Infrastructure
irods-microservices
Commits
a2e47376
Commit
a2e47376
authored
7 years ago
by
Lazlo Westerhof
Browse files
Options
Downloads
Patches
Plain Diff
Also support uppercasing ß etc.
parent
7cbf2378
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/msiStrToUpper.cc
+4
-26
4 additions, 26 deletions
src/msiStrToUpper.cc
with
4 additions
and
26 deletions
src/msiStrToUpper.cc
+
4
−
26
View file @
a2e47376
...
@@ -25,41 +25,19 @@
...
@@ -25,41 +25,19 @@
#include
"irods_includes.hh"
#include
"irods_includes.hh"
#include
"reGlobalsExtern.hpp"
#include
"reGlobalsExtern.hpp"
#include
"genQuery.h"
#include
<boost/locale
/encoding_utf
.hpp>
#include
<boost/locale.hpp>
#include
<string>
#include
<string>
#include
<locale>
#include
<locale>
using
boost
::
locale
::
conv
::
utf_to_utf
;
std
::
locale
const
utf8
(
"en_US.UTF-8"
);
/* Convert UTF-8 byte string to wstring. */
std
::
wstring
toWstring
(
const
std
::
string
&
str
)
{
return
utf_to_utf
<
wchar_t
>
(
str
.
c_str
(),
str
.
c_str
()
+
str
.
size
());
}
/* Convert wstring to UTF-8 byte string. */
std
::
string
toString
(
const
std
::
wstring
&
str
)
{
return
utf_to_utf
<
char
>
(
str
.
c_str
(),
str
.
c_str
()
+
str
.
size
());
}
/* Converts a UTF-8 encoded string to upper case. */
std
::
string
toUpper
(
std
::
string
const
&
s
)
{
auto
ss
=
toWstring
(
s
);
for
(
auto
&
c
:
ss
)
{
c
=
std
::
toupper
(
c
,
utf8
);
}
return
toString
(
ss
);
}
extern
"C"
{
extern
"C"
{
int
msiStrToUpper
(
msParam_t
*
in
,
msParam_t
*
out
,
ruleExecInfo_t
*
rei
)
{
int
msiStrToUpper
(
msParam_t
*
in
,
msParam_t
*
out
,
ruleExecInfo_t
*
rei
)
{
std
::
string
inStr
=
parseMspForStr
(
in
);
std
::
string
inStr
=
parseMspForStr
(
in
);
std
::
string
outStr
=
toUpper
(
inStr
);
boost
::
locale
::
generator
gen
;
std
::
locale
utf8
(
gen
(
"en_US.UTF-8"
));
auto
outStr
=
boost
::
locale
::
to_upper
(
inStr
,
utf8
);
fillStrInMsParam
(
out
,
outStr
.
c_str
());
fillStrInMsParam
(
out
,
outStr
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment