aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1/asn1_str.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/asn1/asn1_str.cpp')
-rw-r--r--src/lib/asn1/asn1_str.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/asn1/asn1_str.cpp b/src/lib/asn1/asn1_str.cpp
index 809448888..fca0f442a 100644
--- a/src/lib/asn1/asn1_str.cpp
+++ b/src/lib/asn1/asn1_str.cpp
@@ -62,9 +62,8 @@ ASN1_Tag choose_encoding(const std::string& str,
/*
* Create an ASN1_String
*/
-ASN1_String::ASN1_String(const std::string& str, ASN1_Tag t) : m_tag(t)
+ASN1_String::ASN1_String(const std::string& str, ASN1_Tag t) : m_iso_8859_str(Charset::transcode(str, LOCAL_CHARSET, LATIN1_CHARSET)), m_tag(t)
{
- m_iso_8859_str = Charset::transcode(str, LOCAL_CHARSET, LATIN1_CHARSET);
if(m_tag == DIRECTORY_STRING)
m_tag = choose_encoding(m_iso_8859_str, "latin1");
@@ -83,11 +82,8 @@ ASN1_String::ASN1_String(const std::string& str, ASN1_Tag t) : m_tag(t)
/*
* Create an ASN1_String
*/
-ASN1_String::ASN1_String(const std::string& str)
- {
- m_iso_8859_str = Charset::transcode(str, LOCAL_CHARSET, LATIN1_CHARSET);
- m_tag = choose_encoding(m_iso_8859_str, "latin1");
- }
+ASN1_String::ASN1_String(const std::string& str) : m_iso_8859_str(Charset::transcode(str, LOCAL_CHARSET, LATIN1_CHARSET)), m_tag(choose_encoding(m_iso_8859_str, "latin1"))
+ {}
/*
* Return this string in ISO 8859-1 encoding