ๆญค็บ้ๅฐใ็งป้คใUnicode Emoji ๅ็คบ ๆ้็ผ็ๅฐๅฑฌๅฅไปถ๏ผ ๆจๅฏไปฅ้้่ฉฒๅฅไปถ็งป้คไปคไบบๅฐๆพ็ Emoji ็ฌฆ่ใ ( It can remove any of the emoji supported by that package. )
via Rubygems
gem install remove_emoji
In your Gemfile:
gem 'remove_emoji'
ไฝฟ็จๆนๅผๅพ็ฐกๅฎ๏ผๅ ้่ฆๅผๅซ RemoveEmoji::Sanitize.call ้ๅ ฅไฝ ่ฆ้ๆฟพ็ๅญไธฒๅณๅฏ้ๆฟพใ
require 'remove_emoji'
original_string = "๐ฆ๐ป๐ฆ๐ผ๐ฆ๐ฝ๐ฆ๐พ๐ฆ๐ฟ๐ง๐ง๐ป๐ง๐ผ๐ง๐ฝ๐ง๐พ๐ง๐ฟ๐จ๐จ๐ป"
puts RemoveEmoji::Sanitize.call(original_string)
require 'remove_emoji'
# ==========
# Input
# ==========
original_string = <<-STRING
abcdefghijklmnopqrstuvwxyz....0123456789
ไธๆฅต๏ผ็ฉ็้กๆธ่ป่ฃก๏ผๅไปๆๅๆฅๅๅ
้
ใใใใณใใใใใณใไธกๆนไฝฟ็จใใใไธญ
๐๐๐จ๐ฒ๐ก๐
๐ถ๐บ๐๐ฆ๐๐ฆ๐ฑโ๏ธ๐ฒ๐ฏ๐ฎ๐๐๐๐ฆ
๐โฎ๏ธ๐๐ฏโช๏ธใ๏ธ๐ต๐๐ฏโ๐๐ท๐ฐโ๏ธโ ๏ธ๐ค๐๐โถ๏ธ๐ ๐ฃโ๏ธโฉ๏ธ๐โ๐จ
โฝ๏ธ๐ฒ๐ต๐ฆ๐ณ๏ธ๐ณ๏ธโ๐๐น๐ฒ๐น๐ท๐ค๐ค๐ผ๐๐ฝ๐โ๐ผ๐ฅ๐ฅฆ๐ถ๐ฝ๐
๐ฒ๐๐ฅ๐๐๐๐ฎ๐ฏ๐ฅ ๐ฅข๐ด๐ฅ๐ฅโ๏ธ๐๐๐๐คฃ๐๐
๐โบ๏ธ๐๐๐
๐๐๐๐๐๐๐๐๐คจ๐ง๐ค๐๐๐คฉ๐คฉ๐๐๐๐๐ข๐ฃโน๏ธ๐ฉ๐๐คฏ
๐ฐ๐๐ฆ๐ฒ๐ค๐ค๐ฟ๐น๐ฝโ๐ผ
ใซใฏๆ์ค๊ตญ, ์ผ๋ณธ, ๋ฒ ํธ๋จ ๋ฑ ํ์ ๋ฌธํ๊ถ์ ์ํ๋ ์์์ ์ฌ๋ฌ ๊ตญ๊ฐ์์๋
ํ๊ตญ์ด็ๅทฎๅผๅค๏ผ้ๅธธ่ฎคไธบ่ฟๅญๅจ่ฏๆฑไธ็ๅทฎๅผใไพๅฆ็นไฝไธญๆ้ๅค็จ็โๅ
ูู
ูุทูุฉ ุงูุดุฑู ุงูุฃูุณุท ูููู: ุงูุชุญุฑู ุถุฏ ุฅูุฑุงู ุณูุจุฏุฃ ู
ู ู
ุฌูุณ ุงูุฃู
ู
STRING
# ==========
# Output
# ==========
puts RemoveEmoji::Sanitize.call(original_string)
# Result:
# abcdefghijklmnopqrstuvwxyz....0123456789
# ไธๆฅต๏ผ็ฉ็้กๆธ่ป่ฃก๏ผๅไปๆๅๆฅๅๅ
้
# ใใใใณใใใใใณใไธกๆนไฝฟ็จใใใไธญ
#
#
#
#
#
#
# ใซใฏๆ์ค๊ตญ, ์ผ๋ณธ, ๋ฒ ํธ๋จ ๋ฑ ํ์ ๋ฌธํ๊ถ์ ์ํ๋ ์์์ ์ฌ๋ฌ ๊ตญ๊ฐ์์๋
# ํ๊ตญ์ด็ๅทฎๅผๅค๏ผ้ๅธธ่ฎคไธบ่ฟๅญๅจ่ฏๆฑไธ็ๅทฎๅผใไพๅฆ็นไฝไธญๆ้ๅค็จ็โๅ
# ูู
ูุทูุฉ ุงูุดุฑู ุงูุฃูุณุท ูููู: ุงูุชุญุฑู ุถุฏ ุฅูุฑุงู ุณูุจุฏุฃ ู
ู ู
ุฌูุณ ุงูุฃู
ู
ๆฌๅฐๆกๅๅง็ขผๆก MIT LICENSE ๆๆฌ ( ่ฉณ่ฆ LICENSE ๆชๆก )