Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
たのしいString
Search
ima1zumi
February 25, 2023
670
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
たのしいString
ima1zumi
February 25, 2023
More Decks by ima1zumi
See All by ima1zumi
Is Ruby's Multi-Encoding Overhead Heavy?
ima1zumi
1
2.2k
OSSと私たち: Rubyの開発を支える STORES
ima1zumi
2
160
Ruby Taught Me About Under the Hood
ima1zumi
6
22k
Exploring Reline: Enhancing Command Line Usability
ima1zumi
1
170
10年物のRailsアプリにキャッチアップ!〜コードを読まずに理解したかった〜
ima1zumi
0
160
RubyKaigiの登壇者一覧ページを作った
ima1zumi
0
620
Relineのその後の生活
ima1zumi
0
290
IRB and Reline Kaigi 2024
ima1zumi
0
58
Exploring Reline: Enhancing Command Line Usability
ima1zumi
3
16k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Abbi's Birthday
coloredviolet
2
8k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
Unsuck your backbone
ammeep
672
58k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
340
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
What's in a price? How to price your products and services
michaelherold
247
13k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
600
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Crafting Experiences
bethany
1
170
Paper Plane
katiecoart
PRO
1
51k
Transcript
ͨͷ͍͠String ϓϩάϥϛϯάݴޠRuby30पه೦Πϕϯτ 2023-02-25 ima1zumi
Introduction - @ima1zumi (Mari Imaizumi) - ӬγεςϜϚωδϝϯτॴଐ - IRB and
Reline committer - จࣈͱจࣈίʔυ͕͖
Powered by
Ruby30प͓ΊͰͱ͏͍͟͝·͢🎉
Rubyͷָ͍͠ͱ͜Ζ
String & Encoding
ࠓ͔Β͑Δ จࣈͱจࣈίʔυૢ࡞ 3બ
ᶃ ɺόΠτྻ͔Βจࣈʹ͢
ɺόΠτྻ͔Βจࣈʹ͢ • Integer#chr • Array#pack • String#force_encoding
Integer#chr(encoding) • ίʔυϙΠϯτΛจࣈͱͯ͠ղऍ • Ҿͳ͠ͷ߹US-ASCIIɺASCII-8BITɺEncoding.default_internalͷ ॱͰղऍ
Array#pack • ྻͷ༰ΛҾʹैͬͯύοΫ • "U*" Unicode codepointΛUTF-8ͱͯ͠ղऍͯ͠ฦ͢
String#force_encoding • จࣈίʔυͷΈΛมߋ͠ɺόΠτྻมߋ͠ͳ͍ • ͜͜ͰόΠφϦ(ASCII_8BIT)ͷจࣈίʔυΛUTF-8ʹมߋ
ᶄจࣈԽ͚Λ࡞Δ
จࣈԽ͚Λ࡞Δ • String#force_encoding • String#encode
จࣈԽ͚Λ࡞Δ
จࣈԽ͚Λ࡞Δ
จࣈԽ͚Λ࡞Δ
https://github.com/integrations/slack/issues/1416
ããã«ã¡ã¯ä¸ç ͜Μʹͪੈք
None
None
None
None
None
ããã«ã¡ã¯ä¸ç ͜Μʹͪੈք
ᶅจࣈίʔυΛRubyͰRubyʹՃ
จࣈίʔυΛՃ͢Δ • Encoding#replicate • ҙޙड़
Δ͜ͱ • 1. ࡞Γ͍ͨEncodingͷܗʹͳΔEncodingΛܾΊΔ • 2. Encoding#replicate͢Δ • 3. มϩδοΫΛॻ͘
จࣈίʔυΛఆٛ͢Δ
มϩδοΫΛॻ͘
https://github.com/ima1zumi/ruby_encoding_iroha
Remove Encoding#replicate Ruby 3.3
None
None
Welcome to faster Encodings