JuliaData / JuliaData/WeakRefStrings.jl

setindex! incorrect for non-UTF-8 strings?

Open
#59 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
22
Forks
20
Avg merge
1d 19h
Merged PRs (30d)
1

Description

These two lines don't seem correct to me for non-UTF-8 AbstractString types:
https://github.com/JuliaData/WeakRefStrings.jl/blob/caf4ed477e493309d12502ab0984eec157120925/src/WeakRefStrings.jl#L369-L370

Indeed this will copy the contents of the string even if it uses a different encoding from existing data.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/WeakRefStrings.jl at lines 369-370 and inspect how setindex! handles non-UTF-8 AbstractString values. Reproduce the reported copy behavior with a differently encoded string, then establish the expected encoding-preserving behavior and add coverage showing that the contents are handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.