1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE/modules/juce_core/text
reuk 8b77aca786
CharPointer_UTF16: Make behaviour consistent when iterating through unpaired surrogates
There's a few things going on in this commit:

- The implementation of CharPointer_UTF16 now uses helpers from
  CharacterFunctions to avoid a few instances of magic numbers.
- Where it makes sense, member functions of that class have been DRYed
  by e.g. implementing getAndAdvance in terms of operator*() and
  operator++().
- Added more tests for incrementing/decrementing/dereferencing
  CharPointer_UTF16.

After this change, a CharPointer_UTF16 that points to an unpaired
surrogate will always dereference to a 32-bit character with that
surrogate's value.

Note that dereferencing a CharPointer_UTF16 that points to a high
surrogate at the final code unit in a memory region is inherently
unsafe, because CharPointer_UTF16 can't track its own size, and the
dereference operation will check the following code unit to see whether
it is a low surrogate.
2025-11-18 18:54:47 +00:00
..
juce_Base64.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_Base64.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_CharacterFunctions.cpp MinGW: Remove support 2024-06-27 18:10:21 +01:00
juce_CharacterFunctions.h Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_CharPointer_ASCII.h Text: Improve string validation 2024-09-06 15:40:39 +00:00
juce_CharPointer_UTF8.h Text: Improve string validation 2024-09-06 15:40:39 +00:00
juce_CharPointer_UTF8_test.cpp Text: Refactor UTF-8 test to prevent warnings 2024-09-30 12:49:57 +01:00
juce_CharPointer_UTF16.h CharPointer_UTF16: Make behaviour consistent when iterating through unpaired surrogates 2025-11-18 18:54:47 +00:00
juce_CharPointer_UTF16_test.cpp CharPointer_UTF16: Make behaviour consistent when iterating through unpaired surrogates 2025-11-18 18:54:47 +00:00
juce_CharPointer_UTF32.h Text: Improve string validation 2024-09-06 15:40:39 +00:00
juce_CharPointer_UTF32_test.cpp Text: Improve string validation 2024-09-06 15:40:39 +00:00
juce_Identifier.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_Identifier.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_LocalisedStrings.cpp Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
juce_LocalisedStrings.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_NewLine.h NewLine: Add support for strings appearing on the opposite side of the plus operator 2025-07-14 16:50:08 +01:00
juce_String.cpp Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
juce_String.h Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
juce_StringArray.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_StringArray.h StringArray: Add nodiscard 2025-09-17 12:50:05 +01:00
juce_StringPairArray.cpp Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
juce_StringPairArray.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_StringPool.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_StringPool.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_StringRef.h Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_TextDiff.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_TextDiff.h Update licensing information 2024-04-16 11:39:35 +01:00