| 1 | // Scintilla source code edit control |
| 2 | /** @file DBCS.h |
| 3 | ** Functions to handle DBCS double byte encodings like Shift-JIS. |
| 4 | **/ |
| 5 | // Copyright 2017 by Neil Hodgson <neilh@scintilla.org> |
| 6 | // The License.txt file describes the conditions under which this software may be distributed. |
| 7 | |
| 8 | #ifndef DBCS_H |
| 9 | #define DBCS_H |
| 10 | |
| 11 | namespace Scintilla::Internal { |
| 12 | |
| 13 | constexpr bool IsDBCSCodePage(int codePage) noexcept { |
| 14 | return codePage == 932 |
| 15 | || codePage == 936 |
| 16 | || codePage == 949 |
| 17 | || codePage == 950 |
| 18 | || codePage == 1361; |
| 19 | } |
| 20 | |
| 21 | bool DBCSIsLeadByte(int codePage, char ch) noexcept; |
| 22 | bool IsDBCSValidSingleByte(int codePage, int ch) noexcept; |
| 23 | |
| 24 | } |
| 25 | |
| 26 | #endif |
| 27 | |