forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encode multi char code points correctly in RestEasy Reactive
- Fixes quarkusio#10134 - Cherry-picks the commit from RestEasy Classic: resteasy/resteasy@a025820 (cherry picked from commit 054adb6)
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
...tive/common/runtime/src/test/java/org/jboss/resteasy/reactive/common/util/EncodeTest.java
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,18 @@ | ||
package org.jboss.resteasy.reactive.common.util; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.net.URLEncoder; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class EncodeTest { | ||
@Test | ||
void encodeEmoji() { | ||
String emoji = "\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00"; | ||
String encodedEmoji = URLEncoder.encode(emoji, StandardCharsets.UTF_8); | ||
assertEquals(encodedEmoji, Encode.encodePath(emoji)); | ||
assertEquals(encodedEmoji, Encode.encodeQueryParam(emoji)); | ||
} | ||
} |