Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-libclient
Commits
0251b1f0
Commit
0251b1f0
authored
Nov 08, 2019
by
Andreas Traczyk
Committed by
Ming Rui Zhang
Nov 08, 2019
Browse files
vcard: use utf-8 codec when streaming to/from vcard files
Change-Id: I953ae1a5bcf0b242b07e5bb9a5ec10c5155ee271
parent
afeccc54
Changes
1
Show whitespace changes
Inline
Side-by-side
src/authority/storagehelper.cpp
View file @
0251b1f0
...
...
@@ -235,7 +235,9 @@ setProfile(const std::string& accountId,
qWarning
().
noquote
()
<<
"Can't open file for writing: "
<<
filePath
;
return
;
}
QTextStream
(
&
file
)
<<
QString
::
fromStdString
(
vcard
);
QTextStream
in
(
&
file
);
in
.
setCodec
(
"UTF-8"
);
in
<<
QString
::
fromStdString
(
vcard
);
}
}
// namespace vcard
...
...
@@ -284,6 +286,7 @@ getAccountAvatar(const std::string& accountId)
return
{};
}
QTextStream
in
(
&
file
);
in
.
setCodec
(
"UTF-8"
);
const
auto
vCard
=
lrc
::
vCard
::
utils
::
toHashMap
(
in
.
readAll
().
toUtf8
());
const
auto
photo
=
(
vCard
.
find
(
vCard
::
Property
::
PHOTO_PNG
)
==
vCard
.
end
())
?
vCard
[
vCard
::
Property
::
PHOTO_JPEG
]
:
vCard
[
vCard
::
Property
::
PHOTO_PNG
];
...
...
@@ -320,6 +323,7 @@ buildContactFromProfile(const std::string & accountId,
}
}
QTextStream
in
(
&
file
);
in
.
setCodec
(
"UTF-8"
);
QByteArray
vcard
=
in
.
readAll
().
toUtf8
();
const
auto
vCard
=
lrc
::
vCard
::
utils
::
toHashMap
(
vcard
);
const
auto
alias
=
vCard
[
vCard
::
Property
::
FORMATTED_NAME
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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