Commit Graph

80 Commits

Author SHA1 Message Date
sfan5 5df60d85f7 Cache iconv context per-thread 2024-03-30 11:07:02 +01:00
sfan5 008d6be900 Rework iconv encoding detection
WCHAR_T doesn't seem as portable as we thought, so it's just easier
to detect the right encoding using macros at this point.
2024-03-30 11:07:02 +01:00
rubenwardy 24cc33e704
Add button_url[] and hypertext element to allow mods to open web pages (#13825)
Fixes #12500
2024-03-24 17:19:23 +00:00
sfan5 bc4ab8b99e General code refactoring/improvements in server, treegen and connection 2024-03-20 16:37:32 +01:00
sfan5 6ca214fefc
Introduce `std::string_view` into wider use (#14368) 2024-02-17 15:35:33 +01:00
techno-sam 176e674a51
Add wear bar color API (#13328)
---------

Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-02-02 21:21:00 +01:00
sfan5 1ba26d67bd Remove excessive includes from porting.h 2024-01-14 13:17:53 +01:00
sfan5 961652c2e9 Address some clang-tidy warnings 2023-12-25 10:07:28 +01:00
Nekobit 50234b8e5c
Fix string conversion for FreeBSD (#13648) 2023-07-17 20:46:06 +02:00
sfan5 15445a0fbe Raise and clean up _WIN32_WINNT constant 2023-05-11 22:51:01 +02:00
rubenwardy 4158b72971
Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
Desour 67068cfaf4 Get rid of wgettext 2023-04-08 20:17:50 +02:00
Mantar 95d7fcb949
Apply NetBSD string conversion workaround to OpenBSD as well (#12618) 2022-07-31 15:18:19 +02:00
savilli 1f39948bc3
Fix BSD iconv declaration 2022-06-05 15:20:29 +02:00
Lars Müller fccf1e2eac
Support CSS Color Module Level 4 (#12204) 2022-04-27 17:00:02 -04:00
ShadowNinja dae6fe91a1 Update directory name sanitization
Only ASCII spaces have to be handles specially, and leading spaces are
also disallowed.
2022-04-08 14:55:21 +01:00
ShadowNinja 00ebedad93 Add additional reserved directory names 2022-04-08 14:55:21 +01:00
ShadowNinja 29d2b2ccd0
Print announce error response (#11878)
Fix HTTPFetch caller and request ID to 64 bits
Check that allocated caller ID is not DISCARD
Print body if serverlist request returns error
Don't print control characters from HTTP responses
Document special HTTPFetch caller IDs
Allow unicode to be printed
2022-01-01 22:44:56 +01:00
nia 2628316842
Fix src/util/string.cpp on NetBSD
- iconv() prototype changed from traditional Unix defintion
  to POSIX definition in 9.99.x.
- wchar_t is not a valid character set for iconv. Share code
  with Android for using UTF-32.
2021-09-19 20:23:52 +02:00
Vincent Robinson 074e6a67de
Add `minetest.colorspec_to_colorstring` (#10425) 2021-04-23 21:37:24 +02:00
sfan5 c834d2ab25 Drop wide/narrow conversion functions
The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
2021-02-02 20:46:08 +01:00
sfan5 5e392cf34f Refactor utf8_to_wide/wide_to_utf8 functions 2021-02-02 20:46:08 +01:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
Hugues Ross 3ce03d1c2a
Sanitize world directory names on create. Keep original name separate (#9432)
Blacklisted characters are replaced by '_' in the path. The display name is stored in world.mt, and duplicate file names are resolved by adding an incrementing suffix (_1, _2, _3, etc).
2020-07-28 19:16:57 +02:00
EvidenceB Kidscode cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
Maksim 23c6d0c31f
Android: fix handling non-latin characters on older Android devices (#9309) 2020-04-17 23:46:30 +02:00
Jean-Patrick Guerrero 0e88176db8
GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw conversion (#9437)
Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
2020-03-07 14:01:11 +01:00
Maksim c396800629 Android: fix cyrillic characters, update iconv lib (#9117) 2020-01-13 07:10:15 +01:00
Pierre-Yves Rollo 72416a6a1f Formspec: add hypertext element 2019-11-03 11:45:33 +01:00
HybridDog 53dd781927 Fix memory leak in guiConfirmRegistration 2018-07-06 11:13:18 +02:00
Thomas--S 9577a4396a Formspecs: Allow setting alpha value for the box[] element 2018-04-23 18:50:50 +01:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
Ekdohibs 6761e21383 Translations: prevent remote crash with invalid translations 2017-08-25 13:06:59 +02:00
Ekdohibs b24e6433df Add clientside translations. 2017-08-24 17:54:10 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
ShadowNinja 77597c4ff3 Clean up numeric.h and split FacePositionCache from it
I also optiized FacePositionCache a bit: I removed a map
lookup and vector copy from both branches of getFacePosition.
2017-05-06 16:09:45 -04:00
sapier d03b4fb627 Add color names from web page referenced in luaapi doc 2017-01-15 02:03:51 +00:00
kwolekr 27aff22a9b Random misc. warning fixes and cleanups
- Fix unused c_sand member warning in Valleys Mapgen
 - Fix some code style
 - Make some std::string params const ref
2016-06-11 03:23:53 -04:00
Ekdohibs 48939df9a5 Escape more strings: formspecs, item descriptions, infotexts...
Also, change the escape character to the more standard \x1b
Thus, it can be used in the future for translation or colored text,
for example.
2016-04-24 03:54:11 +10:00
Ekdohibs 095f623fa7 Remove chat escape sequences from chat messages, for future colored chat. 2016-03-15 17:33:15 +01:00
Rui 3a2bfd4548 Fix indianred and indigo of color-string 2015-08-19 19:49:45 +02:00
est31 457d42c599 Android: bypass broken wide_to_utf8 with wide_to_narrow (again)
This bypass had to be re-enabled as some users reported issues,
even after the iconv build fix.

While utf8_to_wide works well, wide_to_utf8 is quite broken
on android, for some reason, and some devices (unrelated from build
configuration).
2015-08-19 18:38:00 +02:00
est31 eb3aac20c8 Android: fix horrible libiconv build
Before, our libiconv build was a joke. We first called configure for our own build host system,
then called make, before we executed a Android.mk script we provided as patch. The first "native make"
always failed, and the LIBICONV_LIB file setting in our Makefile didn't match the built one,
resulting in an always-rebuild of iconv.

This commit cleans up this total mess, removes the double-build, and the Android.mk, and properly calls
./configure with the according target platform, and uses a built toolchain.

As we have to deal with the android bug "NDK: Support for prebuild libs with full sonames"
https://code.google.com/p/android/issues/detail?id=55868
as the 2013 patch
https://lists.gnu.org/archive/html/libtool-patches/2013-06/msg00002.html
by Google's David Turner wasn't inside the 2011 libtool, we pass -avoid-version to
libtool.

Thanks to the proper build, wide_to_utf8 works for android now, removing us of the need to disable it.
2015-07-29 15:59:06 +02:00
est31 b0784ba871 Use UTF-8 instead of narrow
Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places.
Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
2015-07-08 10:12:44 +02:00
kwolekr 4e28c8d3c8 Fix *BSD build with GNU iconv 2015-06-29 12:32:01 +02:00
est31 6f8bdda90e Fix string conversion error message 2015-06-23 15:04:14 +02:00
est31 6dcf549ba9 Fail iconv call gracefully
No freezing when inbuf_size doesn't decrease over time.
2015-06-17 19:03:58 +02:00
est31 60f31ad523 Android: bypass broken wide_to_utf8 with wide_to_narrow
While utf8_to_wide works well, wide_to_utf8 is quite broken
on android, for some reason.
2015-06-14 08:25:21 +02:00
est31 572990dcd3 Add utf-8 conversion utilities and re-add intlGUIEditBox 2015-06-13 19:49:55 +02:00
est31 82e35edff5 Make early protocol auth mechanism generic, and add SRP
Adds everything needed for SRP (and everything works too),
but still deactivated, as protocol v25 init packets aren't final yet.
Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25
inside networkprotocol.h.
2015-05-11 18:40:27 +02:00