-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1886 from robstoll/bugfix/1884-regex-surrogate-co…
…de-points #1884 take surrogate code points into account in RegexSearcher
- Loading branch information
Showing
7 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/core/polyfills/charExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ch.tutteli.atrium.core.polyfills | ||
|
||
/** | ||
* Indicates if the char is a [High-Surrogate Code Unit](http://www.unicode.org/glossary/#high_surrogate_code_unit). | ||
* @return true if it is a high-surrogate code unit, false otherwise. | ||
* | ||
* @since 1.3.0 | ||
*/ | ||
expect fun Char.isHighSurrogate(): Boolean |
8 changes: 8 additions & 0 deletions
8
atrium-core/src/jsMain/kotlin/ch/tutteli/atrium/core/polyfills/isHighSurrogate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package ch.tutteli.atrium.core.polyfills | ||
|
||
const val SURROGATE_RANGE_START = '\uD800' | ||
const val SURROGATE_RANGE_END_INCLUSIVE = '\uDBFF' | ||
|
||
actual fun Char.isHighSurrogate(): Boolean = | ||
this >= SURROGATE_RANGE_START && this <= SURROGATE_RANGE_END_INCLUSIVE; | ||
|
4 changes: 4 additions & 0 deletions
4
atrium-core/src/jvmMain/kotlin/ch/tutteli/atrium/core/polyfills/charExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ch.tutteli.atrium.core.polyfills | ||
|
||
actual fun Char.isHighSurrogate(): Boolean = Character.isHighSurrogate(this) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters