Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Improved Windows console text handling #79

Merged
merged 13 commits into from
Nov 3, 2023

Conversation

dragonmux
Copy link
Member

This PR aims to improve how we handle strings in console_t/consoleStream_t on Windows and in general Unicode handling on output.

This fixes an issue where std::string's containing UTF-8 would not get converted on Windows, resulting in garbled output.

We also implement support for std::wstring/wchar_t and std::u16String/char16_t strings though the former is only for Windows. This should allow any UTF-16 or wide Windows character strings to be correctly displayed in a program's output just the same as any other strings.

Some of the architectural changes should also provide a nice speed boost for STL string containers by not throwing away the length information only to have to re-calculate it.

@dragonmux dragonmux added bug Something isn't working enhancement New feature or request labels Nov 1, 2023
@dragonmux dragonmux force-pushed the feature/improved-windows-console-text-handling branch from 0ecc4ca to 12f57b0 Compare November 1, 2023 00:59
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #79 (fb4dbe0) into main (c94ee1d) will decrease coverage by 0.62%.
The diff coverage is 19.69%.

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
- Coverage   90.38%   89.77%   -0.62%     
==========================================
  Files          47       47              
  Lines        3277     3414     +137     
  Branches      644      660      +16     
==========================================
+ Hits         2962     3065     +103     
- Misses        247      313      +66     
+ Partials       68       36      -32     
Files Coverage Δ
impl/socket.cxx 83.33% <ø> (ø)
substrate/console 95.06% <33.33%> (-1.19%) ⬇️
impl/console.cxx 59.88% <19.04%> (-18.31%) ⬇️

... and 8 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Copy link
Collaborator

@amyspark amyspark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the test suite needing some love, there is one issue that requires sorting out.

impl/socket.cxx Outdated Show resolved Hide resolved
@dragonmux dragonmux force-pushed the feature/improved-windows-console-text-handling branch 2 times, most recently from acefa09 to cc303f4 Compare November 1, 2023 17:21
@dragonmux dragonmux force-pushed the feature/improved-windows-console-text-handling branch from 515449c to fb4dbe0 Compare November 3, 2023 00:50
@dragonmux dragonmux merged commit fb4dbe0 into main Nov 3, 2023
165 of 167 checks passed
@dragonmux dragonmux deleted the feature/improved-windows-console-text-handling branch November 3, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants