Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 7 | #ifndef FXBARCODE_BC_UTILCODINGCONVERT_H_ |
| 8 | #define FXBARCODE_BC_UTILCODINGCONVERT_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 10 | #include <vector> |
| 11 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 12 | #include "core/fxcrt/fx_basic.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 13 | |
| 14 | class CBC_UtilCodingConvert { |
| 15 | public: |
| 16 | CBC_UtilCodingConvert(); |
| 17 | virtual ~CBC_UtilCodingConvert(); |
| 18 | static void UnicodeToLocale(const CFX_WideString& source, |
| 19 | CFX_ByteString& result); |
| 20 | static void LocaleToUtf8(const CFX_ByteString& source, |
| 21 | CFX_ByteString& result); |
tsepez | 82aa396 | 2017-01-20 12:59:50 -0800 | [diff] [blame] | 22 | static void LocaleToUtf8(const CFX_ByteString& source, |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 23 | std::vector<uint8_t>& result); |
| 24 | static void Utf8ToLocale(const std::vector<uint8_t>& source, |
tsepez | 82aa396 | 2017-01-20 12:59:50 -0800 | [diff] [blame] | 25 | CFX_ByteString& result); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 26 | static void Utf8ToLocale(const uint8_t* source, |
| 27 | int32_t count, |
| 28 | CFX_ByteString& result); |
| 29 | static void UnicodeToUTF8(const CFX_WideString& source, |
| 30 | CFX_ByteString& result); |
| 31 | }; |
| 32 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 33 | #endif // FXBARCODE_BC_UTILCODINGCONVERT_H_ |