Karl Zylinski
1f9b4c4555
Add text field to utf8.Grapheme, fix caret translation by grapheme
...
`decode_grapheme_iterate` already computed the text of each grapheme
cluster, but `decode_grapheme_clusters` discarded it, forcing callers to
reconstruct each cluster's range by looking ahead to the next grapheme's
`byte_index`. Store it on `Grapheme` instead; it is a slice of the input
string, so no allocation is involved.
`core:text/edit` was using `Grapheme.width` -- the number of monospace
cells -- as a byte count when moving the caret by grapheme, so it landed
in the middle of a cluster for anything wider than one byte per cell. Use
`len(Grapheme.text)`, and add a test package for the translations.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com >
2026-08-10 12:27:31 +02:00
jack gleeson
2162e7605e
core/unicode/utf8: Fix truncated text for grapheme clusters
2026-08-07 10:36:14 -06:00
gingerBill
55f398b734
Add #no_bounds_check to appropriate procedures
2026-03-15 16:00:40 +00:00
Wrath
06b10f9ae8
Add #optional_allocator_error
2026-02-16 14:40:37 -05:00
wrathdoesthat
f0912ce4c2
Merge branch 'odin-lang:master' into master
2026-02-16 14:38:22 -05:00
Wrath
5c5e337172
Propagate allocator errors from certain unicode functions
2026-02-15 22:27:30 -05:00
DuchGhast
c1df42d991
Fix utf8 validation
2026-02-15 14:49:50 +00:00
gingerBill
db26fb8a21
Add missing @(require_results) to procedures
2026-01-28 13:39:51 +00:00
gingerBill
78e9a22ffa
Fix track_graphemes
2025-10-13 15:47:35 +01:00
gingerBill
2bc7344f27
Add Grapheme_Iterator
2025-10-13 15:28:23 +01:00
Jeroen van Rijn
7a9ea3ee6d
Further overhaul of package line comments.
2025-10-09 23:05:29 +02:00
gingerBill
b8fdd91c9f
Merge pull request #5776 from connnnal/utf8-1-bounds
...
Disable bounds check for the first utf8 byte
2025-10-09 18:33:24 +01:00
gingerBill
c3d4b1f0b5
Add doc line to core:unicode/utf8/utf8string
2025-10-09 13:37:22 +01:00
gingerBill
857c78c22b
Add doc lins to unicode packages
2025-10-09 12:37:18 +01:00
connnnal
ee063e708a
Disable bounds check for the first utf8 byte
...
Known safe from prior `n < 1` check
2025-10-09 11:38:22 +01:00
Karl Zylinski
36b958c120
Fix for using utf8string.at with last rune index returning wrong rune.
2024-10-30 11:10:36 +01:00
gingerBill
3f9a58808c
More style improvements
2024-06-29 19:07:34 +01:00
Feoramund
e620645a03
Measure East_Asian_Width during grapheme decoding
2024-06-19 22:35:36 -04:00
Feoramund
1620a69398
Add decode_grapheme_clusters to core:unicode/utf8
2024-06-17 21:57:32 -04:00
gingerBill
fbf01543d1
Remove duplicate table
2024-04-06 16:59:02 +01:00
gingerBill
3e7e779abf
Replace core:* to base:* where appropriate
2024-01-28 22:18:51 +00:00
gingerBill
39bff40a75
Make many core:unicode/utf8 procedures "contextless"
2023-05-25 11:58:42 +01:00
Laytan Laats
5d54b710e7
fix #2550 json encoding should use surrogate pairs per RFC7159
2023-05-22 17:22:33 +02:00
gingerBill
84a424f21e
Add numerous procedure groups decode_rune, decode_last_rune, rune_count, full_rune
2022-06-16 15:07:07 +01:00
gingerBill
ae6441182d
Add core:unicode/utf8/utf8string to examples/all
2022-03-18 23:32:37 +00:00
gingerBill
0434281f73
Strip semicolons; Make odin strip-semicolon replace .. with ..= if used as a binary operator
2021-09-06 20:15:59 +01:00
gingerBill
251da264ed
Remove unneeded semicolons from the core library
2021-08-31 22:21:13 +01:00
gingerBill
f0437a4242
Enforce core:builtin and core:intrinsics for imports
2021-08-21 13:44:16 +01:00
gingerBill
aa93305015
Replace usage of inline proc with #force_inline proc in the core library
2021-02-23 16:14:47 +00:00
gingerBill
49e140f4db
Add utf8.full_rune
2020-11-10 16:47:56 +00:00
gingerBill
b9076b0d5b
Add package unicode/utf8/utf8string for efficient utf8 codepoint indexing to strings
2020-09-26 23:16:18 +01:00
gingerBill
fc4fdd588e
Remove usage of do in core library
2020-09-23 17:17:14 +01:00
gingerBill
7a4ec48389
Fix missing allocator
2020-01-26 21:10:56 +00:00
gingerBill
a101e0d7ba
Add utf8.string_to_runes utf8.runes_to_string
2020-01-26 20:55:46 +00:00
gingerBill
9db81498d8
Make the string type elements "immutable", akin to char const * in C
...
Allows for extra security and optimization benefits
2019-12-01 14:10:59 +00:00
Kevin Watters
b5fdb3f855
Remove unused variables in utf8.odin.
2019-10-28 11:13:47 -04:00
gingerBill
0977ac111a
Fix typo in package utf8; add wchar_t to package c
2019-10-27 08:34:20 +00:00
gingerBill
2db16d6a32
Add for package utf8: rune_at_pos, rune_string_at_pos, rune_at, rune_offset
2019-10-26 15:05:36 +01:00
gingerBill
1734eb949f
Update utf8.accept_sizes to use ranged fields
2019-10-26 14:18:38 +01:00
gingerBill
1da0668653
Add utf8.rune_index
2019-10-26 11:50:01 +01:00
gingerBill
f25818e923
Make procedure parameters just named values rather than copied variables
2019-07-15 21:18:37 +01:00
gingerBill
9b4b20e8b1
package dynlib
2019-03-03 12:08:26 +00:00
gingerBill
1c9656aedb
Vet core library
2018-12-31 15:50:49 +00:00
gingerBill
8662df2b7f
Update package strings
2018-12-26 19:33:56 +00:00
gingerBill
0718f14774
Reduce number of range and slice operators #239
...
Replace .. and ... with : and ..
2018-08-01 21:34:59 +01:00
gingerBill
3eb8aa8268
Modify CommentGroup parsing
2018-06-17 10:29:20 +01:00
gingerBill
5b6770f3d2
Parse directories to be packages
2018-05-21 20:47:52 +01:00