FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
unidecode/include/unidecode/unidecode.hpp at master · MeanSquaredError/unidecode · GitHub
MeanSquaredError
/
unidecode
Public
forked from
marekru/unidecode
Notifications
You must be signed in to change notification settings
Fork
1
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
unidecode
/
include
/
unidecode
/
unidecode.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (32 loc) · 1.23 KB
Breadcrumbs
unidecode
/
include
/
unidecode
/
unidecode.hpp
Copy path
File metadata and controls
43 lines (32 loc) · 1.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
//
Created by Marek on 30.9.2019.
//
#
pragma
once
#
include
"
common.hpp
"
#
include
"
sections.hpp
"
namespace
unidecode
{
template
<
typename
InputIterator,
typename
OutputIterator>
void
Unidecode
(
const
InputIterator& in_begin,
const
InputIterator& in_end, OutputIterator out_it) {
for
(
auto
it = in_begin; it != in_end; ++it) {
unicode_char codepoint = *it;
//
TODO: function from this !
if
(codepoint <
0x80
) {
*out_it =
static_cast
<
char
>(codepoint);
++out_it;
}
else
if
(codepoint <=
0xeffff
) {
//
Characters in Private Use Area and above are ignored
uint32_t
section = codepoint >>
8
;
uint32_t
position = codepoint &
0xff
;
//
only ast two hex digits
//
TODO: assert section < then xyz
auto
table =
kUnidecodeData
[section];
if
(table !=
nullptr
) {
//
TODO: check if position < table size
const
char
* symbol = table[position];
while
(*symbol !=
0
) {
*out_it = *symbol;
++out_it;
symbol++;
}
}
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL