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
1
540
たのしいString
ima1zumi
February 25, 2023
Tweet
Share
More Decks by ima1zumi
See All by ima1zumi
Exploring Reline: Enhancing Command Line Usability
ima1zumi
0
32
10年物のRailsアプリにキャッチアップ!〜コードを読まずに理解したかった〜
ima1zumi
0
55
RubyKaigiの登壇者一覧ページを作った
ima1zumi
0
220
Relineのその後の生活
ima1zumi
0
180
IRB and Reline Kaigi 2024
ima1zumi
0
7
Exploring Reline: Enhancing Command Line Usability
ima1zumi
3
13k
Reline 1分 Cooking
ima1zumi
0
22
続・mruby/cにUTF-8 を実装する
ima1zumi
1
22
UTF-8 is coming to mruby/c
ima1zumi
4
5.2k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
3k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Why Our Code Smells
bkeepers
PRO
335
57k
Building Applications with DynamoDB
mza
91
6.1k
Practical Orchestrator
shlominoach
186
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Code Reviewing Like a Champion
maltzj
520
39k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
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