Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
e575df6c
Commit
e575df6c
authored
Aug 24, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed UTF8 decoding for non-unicode build;
conclusion: @#%!@#% ASCII/Windows-1252/ISO-8859 must die!
parent
2fdd7eb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
src/gui/set/window.cpp
src/gui/set/window.cpp
+1
-1
src/util/io/reader.cpp
src/util/io/reader.cpp
+27
-2
No files found.
src/gui/set/window.cpp
View file @
e575df6c
...
...
@@ -402,7 +402,7 @@ void SetWindow::onUpdateUI(wxUpdateUIEvent& ev) {
}
}
static
const
int
FILE_MENU_SIZE_BEFORE_RECENT_SETS
=
1
1
;
// HACK; we should calculate the position to insert!
static
const
int
FILE_MENU_SIZE_BEFORE_RECENT_SETS
=
1
2
;
// HACK; we should calculate the position to insert!
void
SetWindow
::
updateRecentSets
()
{
wxMenuBar
*
mb
=
GetMenuBar
();
assert
(
number_of_recent_sets
<=
(
UInt
)
settings
.
recent_sets
.
size
());
// the number of recent sets should only increase
...
...
src/util/io/reader.cpp
View file @
e575df6c
...
...
@@ -147,10 +147,35 @@ String read_utf8_line(wxInputStream& input, bool eat_bom, bool until_eof) {
Char
*
result_buf
=
result
.
GetWriteBuf
(
size
+
1
);
wxConvUTF8
.
MB2WC
(
result_buf
,
&
buffer
[
0
],
size
+
1
);
result
.
UngetWriteBuf
(
size
);
return
eat_bom
?
decodeUTF8BOM
(
result
)
:
result
;
#else
result
=
String
(
&
buffer
[
0
],
*
wxConvCurrent
);
// first to wchar, then back to local
vector
<
wchar_t
>
buf2
;
buf2
.
resize
(
size
+
1
);
wxConvUTF8
.
MB2WC
(
&
buf2
[
0
],
&
buffer
[
0
],
size
+
1
);
// eat BOM?
if
(
eat_bom
&&
buf2
[
0
]
==
0xFEFF
)
{
buf2
.
erase
(
buf2
.
begin
());
// remove BOM
}
// convert
#ifdef __WXMSW__
// size includes null terminator
size
=
::
WideCharToMultiByte
(
CP_ACP
,
0
,
&
buf2
[
0
],
-
1
,
nullptr
,
0
,
nullptr
,
nullptr
);
Char
*
result_buf
=
result
.
GetWriteBuf
(
size
);
::
WideCharToMultiByte
(
CP_ACP
,
0
,
&
buf2
[
0
],
-
1
,
result_buf
,
(
int
)
size
,
nullptr
,
nullptr
);
result
.
UngetWriteBuf
(
size
-
1
);
#else
for
(
size_t
i
=
0
;
i
<
size
;
++
i
)
{
wchar_t
wc
=
buf2
[
i
];
if
(
wc
<
0xFF
)
{
result
+=
(
Char
)
wc
;
}
else
{
// not valid in Latin1
result
+=
'?'
;
}
}
#endif
return
result
;
#endif
return
eat_bom
?
decodeUTF8BOM
(
result
)
:
result
;
}
void
Reader
::
readLine
(
bool
in_string
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment