Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
best-practical
rt
Commits
bc8e5e94
Commit
bc8e5e94
authored
Aug 08, 2014
by
Alex Vandiver
Browse files
Comment the logic for database decode_utf8/is_utf8 checking
parent
89a85683
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/RT/Record.pm
View file @
bc8e5e94
...
...
@@ -656,12 +656,16 @@ sub __Value {
return
undef
if
(
!
defined
$value
);
# Pg returns character columns as character strings; mysql and
# sqlite return them as bytes. While mysql can be made to return
# characters, using the mysql_enable_utf8 flag, the "Content" column
# is bytes on mysql and characters on Postgres, making true
# consistency impossible.
if
(
$args
{'
decode_utf8
'}
)
{
if
(
!
utf8::
is_utf8
(
$value
)
)
{
if
(
!
utf8::
is_utf8
(
$value
)
)
{
# mysql/sqlite
utf8::
decode
(
$value
);
}
}
else
{
}
else
{
if
(
utf8::
is_utf8
(
$value
)
)
{
utf8::
encode
(
$value
);
}
...
...
lib/RT/Report/Tickets.pm
View file @
bc8e5e94
...
...
@@ -745,6 +745,9 @@ sub MapSubValues {
my
$dst
=
$item
->
{'
values
'}{
lc
$to
}
=
{
};
while
(
my
(
$k
,
$v
)
=
each
%
{
$map
}
)
{
$dst
->
{
$k
}
=
delete
$item
->
{'
values
'}{
lc
$v
->
{'
NAME
'}
};
# This mirrors the logic in RT::Record::__Value When that
# ceases tp use the UTF-8 flag as a character/byte
# distinction from the database, this can as well.
utf8::
decode
(
$dst
->
{
$k
}
)
if
defined
$dst
->
{
$k
}
and
not
utf8::
is_utf8
(
$dst
->
{
$k
}
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment