2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
18 #ifndef ENCODING_CONVERSION_H
19 #define ENCODING_CONVERSION_H
21 #include "common/HereMaps_global.h"
25 #ifndef TIZEN_MIGRATION
26 namespace Tizen{ namespace Base{ class ByteBuffer; } }
29 HERE_MAPS_BEGIN_NAMESPACE
32 * This class offers encoding conversion utilities between UTF-8 and platform
33 * default string encoding.
35 class EncodingConversion
39 * This method converts a platform string to UTF-8.
41 * @param sSrc A constant reference to a platform string to convert.
43 * @param sDst A reference to a string object holding the results of
44 * conversion to UTF-8.
46 * @return Always <code>true</code>.
48 static bool ToUTF8(const WString& sSrc, std::string& sDst);
52 * This method converts a UTF-8 string to a platform string.
54 * @param sSrc A constant reference to an unsigned character buffer
55 * containing the string to convert.
57 * @param uLen A value representing the length of the buffer containing the
60 * @param sDst A reference to a string object holding the results of
61 * conversion from UTF-8.
63 * @return Always <code>true</code>.
65 static bool FromUTF8(const char* pSrc, size_t uLen, WString& sDst);
68 HERE_MAPS_NO_COPY_NO_ASSIGN(EncodingConversion);
72 HERE_MAPS_END_NAMESPACE