Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
たのしいString
Search
ima1zumi
February 25, 2023
1
620
たのしいString
ima1zumi
February 25, 2023
Tweet
Share
More Decks by ima1zumi
See All by ima1zumi
Ruby Taught Me About Under the Hood
ima1zumi
6
18k
Exploring Reline: Enhancing Command Line Usability
ima1zumi
1
120
10年物のRailsアプリにキャッチアップ!〜コードを読まずに理解したかった〜
ima1zumi
0
130
RubyKaigiの登壇者一覧ページを作った
ima1zumi
0
500
Relineのその後の生活
ima1zumi
0
250
IRB and Reline Kaigi 2024
ima1zumi
0
27
Exploring Reline: Enhancing Command Line Usability
ima1zumi
3
15k
Reline 1分 Cooking
ima1zumi
0
47
続・mruby/cにUTF-8 を実装する
ima1zumi
1
40
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Bash Introduction
62gerente
615
210k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
[SF Ruby Conf 2025] Rails X
palkan
0
480
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Pragmatic Product Professional
lauravandoore
37
7.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
121
20k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
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