45 Commits

Author SHA1 Message Date
Le Philousophe 58362a6ada COMMON: Improve punyencode performance
When dealing with empty or ASCII strings, don't call UTF-8 conversion
routines as it's not needed.
Decrease the number of append calls.
2025-08-07 20:04:24 +02:00
Le Philousophe 890b0c49bf COMMON: Make punycode_needEncode coherent with punycode_encode
This is a follow-up of b930232e6d
2024-11-15 09:37:18 +01:00
Le Philousophe b930232e6d COMMON: Punyencode path if it's already encoded.
This allows to have puny-encoded folders on disk and use them without
seeing them decoded by ScummVM like if they were encoded by us.
2024-06-15 02:07:38 +02:00
Le Philousophe 6f46727c77 COMMON: Check if string is puny encoded before trying to decode it
This avoids the following useless conversion String->U32String->String
while the content will not change.
2023-12-24 13:19:25 +01:00
Le Philousophe 23fda47ac8 COMMON: Improve punydecode performance
Avoid copies as much as we can by working in place.
2023-12-24 13:19:25 +01:00
D G Turner 231d7ffaee COMMON: Fix Signed vs. Unsigned GCC Compiler Warnings in Punycode 2023-06-25 15:45:26 +01:00
Misty De Meo 90c4b57e9a COMMON: punycode: move npos guard up
b0d722473b introduced code that used
ni before this guard that ensures it has a proper value for strings
that contain no ASCII component.
2023-06-07 14:55:41 -07:00
Misty De Meo fb5982eacb COMMON: do not process the tail if there is no tail
If the illegal character scanner flags the final character, it
shouldn't continue on try to process the tail - it's the end of the
string, and indexing past that is invalid.
2023-06-07 11:58:05 -07:00
Eugene Sandulenko 47a1a1b86c COMMON: Make punycode warnings more useable 2023-04-01 18:29:41 +02:00
Eugene Sandulenko b5042c8513 COMMON: Do not crash on attempt to punyencode empty strings 2023-03-03 23:22:34 +01:00
Vladimir Serbinenko af7d9cb850 COMMON: Move punycode_*codepath to path.cpp
This allows to reduce access to DIR_SEPARATOR from outside of Common::Path
2022-12-14 05:08:46 +01:00
D G Turner d136adedd9 COMMON: Fix Signed vs. Unsigned Comparison Warnings in Punycode 2022-07-05 21:52:28 +01:00
Eugene Sandulenko b0d722473b COMMON: Process common suffixes for punycoded strings 2022-07-05 15:13:08 +02:00
Eugene Sandulenko b84b8ac53c JANITORIAL: Use C++-style comments 2022-07-05 14:21:12 +02:00
Eugene Sandulenko c9d88ac756 COMMON: Do not crash on malformed punycode strings 2022-07-05 14:16:55 +02:00
eientei fa3e3025bf DEVTOOLS: COMPANION, COMMON: Add DEL character to be punycoded 2022-06-24 13:45:34 +02:00
Donovan Watteau 5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 44bc2e2eab COMMON: Fix punycode implementation for upper Unicode characters 2021-10-31 23:00:35 +02:00
Eugene Sandulenko 3b281bd85c COMMON: Further synchronisation of the escape characters for punycode 2021-10-31 19:26:48 +02:00
Eugene Sandulenko b9c5ef933f COMMON: Sync punycode with JS/Python code:
* Allow [] in file names
* Process files ending with spaces or dots
2021-10-31 16:36:27 +02:00
Matthew Duggan 2c4aae5294 COMMON: Use const references where possible in punycode
As suggested by coverity.
2021-09-04 23:15:23 +03:00
djsrv 952dc3d3e1 COMMON: Fix punycoding strings with no ASCII chars 2021-08-22 14:42:33 -04:00
djsrv ad6f533175 COMMON: Fix punycode encoder/decoder
These need to use Unicode code points, not raw bytes.
2021-08-22 13:11:26 -04:00
djsrv 7b71e617f6 COMMON: Fully remove old punycode path functions 2021-08-22 11:45:02 -04:00
djsrv 6020f24661 COMMON: Create punycode_encodepath 2021-08-07 10:44:37 +02:00
djsrv 17297ea7ef COMMON: Use Path type in punycode_decodepath 2021-08-07 10:44:37 +02:00
Eugene Sandulenko e79e58e077 COMMON: Avoid unnecessary object creation 2021-08-01 14:55:39 +02:00
Eugene Sandulenko 11e486d631 COMMON: Replace rindex() with more portable code 2021-08-01 14:51:04 +02:00
Eugene Sandulenko 1f40958a65 COMMON: Punycode more invalid characters in filenames 2021-08-01 10:44:24 +02:00
Eugene Sandulenko ad42c3fd97 COMMON: Fix compilation 2021-07-31 18:30:16 +02:00
Eugene Sandulenko 130270e9cc COMMON: Puny-encode '*', '[', ']' in file names 2021-07-31 17:04:13 +02:00
D G Turner 3f41ffa1c6 COMMON: Further fixes for signedness mismatch warnings in punycode 2021-07-31 13:09:17 +01:00
Orgad Shaneh 36224b990e COMMON: Fix signedness mismatch warnings in punycode 2021-07-28 08:51:17 +03:00
Eugene Sandulenko 163d0b333a COMMON: Make constants more portable 2021-07-27 18:44:00 +02:00
Eugene Sandulenko 83da582b4b COMMON: Fix compilation 2021-07-27 18:42:54 +02:00
Eugene Sandulenko 530354492a COMMON: Fix encode_punycode to match the perl code 2021-07-27 18:14:50 +02:00
Eugene Sandulenko e6429a1213 COMMON: Fix punycode encoding 2021-07-27 18:14:50 +02:00
Eugene Sandulenko 96bb4d2d53 COMMON: Added more auxiliary method to Punycode 2021-07-27 18:14:50 +02:00
Eugene Sandulenko cd3f703988 COMMON: Fix punycode encoding 2021-07-27 18:14:49 +02:00
Eugene Sandulenko 8789bdfd67 COMMON: Reworked encode_punycode to String 2021-07-27 18:14:49 +02:00
Eugene Sandulenko 191bc979a9 COMMON: Always return the original string on failed punycode decoding 2021-07-27 18:14:49 +02:00
Eugene Sandulenko a655cff203 COMMON: Added auxiliary methods for punycode 2021-07-27 18:14:49 +02:00
Eugene Sandulenko 56f7af8d2e COMMON: Fix punycode decoding and implement reverse utility for escaped filenames 2021-07-27 18:14:49 +02:00
Eugene Sandulenko 91d747ac5b COMMON: Initial code for punycode decoding 2021-07-27 18:14:48 +02:00