Skip to content

ASCII 8-bit encoded strings fail comparison even if all ASCII characters #734

Description

@forthrin
#!/usr/bin/env ruby

require 'sqlite3'

db = SQLite3::Database.open("#{Dir.home}/db")
db.execute('create table if not exists foo (bar, unique (bar))')
db.execute('replace into foo values (?)', u = 'a')
a = u.encode('ascii-8bit')
pp a == u
[u, a].each do
  pp db.execute('select * from foo where bar = ?', [it])
end
true
[["a"]]
[]
System Version: macOS 26.5.2 (25F84)
Model Identifier: MacBookAir10,1
ruby 4.0.6 (2026-07-14 revision 03b6d3f889) +PRISM [arm64-darwin25]
sqlite3 (2.9.6)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions