mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Fonts stored in base85 can contain trigraphs. #839
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#839
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When using
the result ends up containing trigraphs like ??( witch will end up replaced to other characters on some build setups.
It might be worth adjusting or changing the base85 algorithm to something like https://github.com/maksverver/base85
Edit:
Nice catch. Who ever remembers about trigraphs nowadays? I'm surprised they affect string literals to be honest, Wikipedia is unclear:
The only places in a C file where two question marks in a row may be used are in multi-character constants, string literals, and commentsThen immediately following
To safely place two consecutive question marks within a string literal, the programmer can use string concatenation "...?""?..." or an escape sequence "...?\?...".Changing the encoding isn't desirable as it would break already encoded data. Instead I added escape characters when there are pairs of ?? as suggested by the wikipedia entry:
https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C.2B.2B
Does that works for you? I didn't test with an old compiler.
Do you have problems with digraphs as well? (
<:%>etc.)I think c++11 and newer remove or disable them by default
Yes.
I can confirm that the submitted changes resolve the issue. Surprisingly I stumbled onto it when using the latest https://github.com/kripken/emscripten-fastcomp-clang . I don't plan on using either trigraphs or diagraphs in any of my projects so I'll be a user of "-Werror=trigraphs" from now on.
Thanks for the help and for this amazing library.