Commit e04cad4
committed
StringRenderer: fix bug with .substring() vs code points...
RFC 6570 section 2.1 defines a character as a Unicode character; which means
code points outside the BMP are possible.
In which case the prefix modifier must return the matching number of code
points, not the number of Java chars. .substring() is therefore not suitable,
neither is .length().1 parent b0d1d7e commit e04cad4
File tree
2 files changed
+13
-3
lines changed- src
- main/java/com/github/fge/uritemplate/render
- test/resources/expand
2 files changed
+13
-3
lines changedLines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
0 commit comments