strCoding.h 1006 Bytes
Newer Older
xiongziliang committed
1
/*
xiongziliang committed
2
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
xiongziliang committed
3
 *
4
 * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
xiongziliang committed
5
 *
xiongziliang committed
6 7 8
 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
xzl committed
9 10 11 12 13 14 15 16 17 18
 */

#ifndef SRC_HTTP_STRCODING_H_
#define SRC_HTTP_STRCODING_H_

#include <iostream>
#include <string>

using namespace std;

xiongziliang committed
19
namespace mediakit {
xzl committed
20 21 22

class strCoding {
public:
23 24
    static string UrlEncode(const string &str); //urlutf8 编码
    static string UrlDecode(const string &str); //urlutf8解码
25
#if defined(_WIN32)
26 27
    static string UTF8ToGB2312(const string &str);//utf_8转为gb2312 
    static string GB2312ToUTF8(const string &str); //gb2312 转utf_8 
28
#endif//defined(_WIN32)
xzl committed
29
private:
30 31
    strCoding(void);
    virtual ~strCoding(void);
xzl committed
32 33
};

xiongziliang committed
34
} /* namespace mediakit */
xzl committed
35 36

#endif /* SRC_HTTP_STRCODING_H_ */