Upgrade to Pro — share decks privately, control downloads, hide ads and more …

macのunicode正規化.pdf

 macのunicode正規化.pdf

Daiki Ikeshima

March 20, 2023
Tweet

More Decks by Daiki Ikeshima

Other Decks in Programming

Transcript

  1. "*νʔϜ஑ౢେथ
    NBDͷ6OJDPEFਖ਼نԽ
    UFDIUBML

    View full-size slide

  2. ϦϯΫ͕ݟ͔ͭΒͳ͍໰୊͕ൃੜ
    HJUMBC্Ͱ؅ཧ͍ͯ͠ΔυΩϡϝϯτதͷϦϯΫ͕ݟ͔ͭΒͳ͍
    "*νʔϜͰ͸HJUMBC্ͰυΩϡϝϯτͷ؅ཧΛߦ͍ͬͯΔ

    XJLJͱൺֱͯ͠ߋ৽࣌ͷϐΞϨϏϡʔ͕΍Γ΍͔ͬͨ͢Γɺ$*ʹΑΔࣗಈνΣοΫ͕΍Γ΍͔ͬͨ͢
    ΓͳͲͷϝϦοτ͕͋Δ
    $*ͰͷࣗಈϦϯΫνΣοΫͰϑΝΠϧ͕ݟ͔ͭΒͳ͍Τϥʔ͕ൃੜ

    ϑΝΠϧ͸͋Δ͸ͣͳͷʹͳΜͰʁʁʁ

    View full-size slide

  3. ݪҼ೔ຊޠϑΝΠϧͷ6OJDPEFਖ਼نԽํ๏ͷϒϨ
    ೔ຊޠϑΝΠϧ໊͕ϑΝΠϧ࣮ମͱϦϯΫͰҰக͍ͯ͠ͳ͔ͬͨͷͰ
    ݟ͔ͭΒͳ͔ͬͨ
    ϑΝΠϧ࣮ମɿ 99σʔλ෼ੳυΩϡϝϯτ
    ϦϯΫɿ 99σʔλ෼ੳυΩϡϝϯτ
    aVD
    aVDaV
    ʮσʯͱ͍͏ͭͷ߹੒ࡁΈจࣈ
    جఈจࣈʮςʯʴ݁߹จࣈʮʃʯͷ݁߹จࣈྻ
    ҧ͏จࣈྻʹͳ͍ͬͯͨͷͰ

    ϦϯΫͷϑΝΠϧ͕ݟ͔ͭΒͳ͍

    View full-size slide

  4. ߹੒ࡁΈจࣈWT݁߹จࣈྻ
    Ͳͬͪ΋߹੒ͱݺͿͱ΍΍͍͜͠ͷͰɺ

    ຊൃදͰ͸ʮ߹੒ࡁΈจࣈʯͱʮ݁߹จࣈྻʯͰݺশ͢Δ
    ߹੒ࡁΈจࣈ
    ໊લ͕΍΍͍͜͠ͷͰࠞಉʹ஫ҙ͕ඞཁɻจࣈͳͷ͔จࣈྻͳͷ͔Ͱ໌֬ʹ۠ผͰ͖Δɻ
    ݁߹จࣈྻʢجఈจࣈʴ݁߹จࣈʣ
    デ
    デ
    aVD aVDaV
    ͜ΕΛ߹੒จࣈͱ͔߹ࣈʢϦΨνϟʣ
    ͱ͔ݺͿ͜ͱ΋͋ΓɺฆΒΘ͍͠
    6$4ʢ6OJDPEFޓ׵ͷࠃࡍඪ४ن֨ʣ
    Ͱ͸߹੒ྻͱݺͿ
    6OJDPEFͷ༻ޠͰɺਖ਼ࣜʹ͸ૹΓԾ໊
    ͳ͠Ͱ߹੒ࡁจࣈ

    View full-size slide

  5. ͳΜͰจࣈ͕ͣΕͨʁ
    ʁʁʁʁʁ
    'JOEFSͰϑΝΠϧΛ࡞੒

    ϑΝΠϧ໊Λ߹੒ࡁΈจࣈʮσʢaVDʣʯͰ࡞੒

    ϑΝΠϧ໊ΛυΩϡϝϯτʹͯ͠ίϐϖͯ͠ϦϯΫΛுΔ

    ߹੒ࡁΈจࣈͷ··ίϐϖ͞Ε͍ͯΔͷͰ͸ʁ

    ϑΝΠϧͱυΩϡϝϯτΛHJUʹίϛοτ

    ϑΝΠϧ΋υΩϡϝϯτ಺ϦϯΫ΋߹੒ࡁΈจࣈͷ͸ͣʁʁ

    ࡞੒
    ϦϯΫ
    HJU

    DPNNJU

    View full-size slide

  6. ͳΜͰจࣈ͕ͣΕͨʁ
    NBDͷ'JOEFSͱHJUͷจࣈྻͷऔΓѻ͍͕ҟͳΔͨΊʹζϨ͕ى͖ͨ
    'JOEFSͰϑΝΠϧΛ࡞੒

    ϑΝΠϧ໊Λ߹੒ࡁΈจࣈʮσʢaVDʣʯͰ࡞੒

    ˠ'JOEFS͕߹੒ࡁΈจࣈΛ෼ղͯ݁͠߹จࣈྻʮσʢaVDaVʣʯʹม׵
    ϑΝΠϧ໊ΛυΩϡϝϯτʹͯ͠ίϐϖͯ͠ϦϯΫΛுΔ

    ߹੒ࡁΈจࣈͷ··ίϐϖ͞Ε͍ͯΔͷͰ͸ʁ

    ˠ'JOEFSͷ࡞ͬͨ݁߹จࣈྻͷϑΝΠϧ໊Λίϐϖ͍ͯͨ͠
    ϑΝΠϧͱυΩϡϝϯτΛHJUʹίϛοτ

    ϑΝΠϧ΋υΩϡϝϯτ಺ϦϯΫ΋߹੒ࡁΈจࣈͷ͸ͣʁʁ

    ˠυΩϡϝϯτ಺ϦϯΫ͸݁߹จࣈྻʮσʢaVDaVʣʯͷ··

    ϑΝΠϧ࣮ମ͸HJU͕߹੒ࡁΈจࣈʮσʢaVDʣʯʹ࠶ม׵͍ͯ͠Δ
    ࡞੒
    ϦϯΫ
    HJU

    DPNNJU

    View full-size slide

  7. 6OJDPEFਖ਼نԽ
    6OJDPEFਖ਼نԽ͸ɺݟͨ໨͕ҰॹͳͷʹίʔυϙΠϯτ͕ҧ͏৔߹ʹ
    ੜ͡ΔࠞཚΛܰݮͤ͞Δͱظ଴͞ΕΔ
    /'% /PSNBMJ[BUJPO'PSN$BOPOJDBM%FDPNQPTJUJPO

    ࢹ֮తɾҙຯతʹ౳Ձͳจࣈྻʹ෼ղ͠ɺ݁߹จࣈྻʹ͢Δ
    /'$ /PSNBMJ[BUJPO'PSN$BOPOJDBM$PNQPTJUJPO

    /'%্ͨ͠Ͱɺࢹ֮తɾҙຯతʹ౳ՁͳจࣈྻΛ߹੒͠ɺ߹੒ࡁΈจࣈʹ͢Δ
    σˠςʃ
    σˠςʃˠσ
    ߹੒ࡁΈจࣈͱ݁߹จࣈྻ͕͍ࠞͬͯ͡Δͱ΍΍͍͜͠ͷͰͲ͔ͬͪʹਖ਼نԽ͢Δ͜ͱ
    ˞ଞʹಉҰจࣈछͷ൑ఆ͕؇͍/',%ɺ/',$΋͋Δ

    View full-size slide

  8. 'JOEFS͕ਖ਼نԽ͍ͯ͠ΔʁNBD04ʁ
    NBD04Ͱ͸ɺ'JOEFS͕߹੒ࡁΈจࣈΛ݁߹จࣈྻʹม׵ͯ͠
    ͓ΓɺϑΝΠϧγεςϜ͸ม׵͍ͯ͠ͳ͍
    NBD04Ͱݕূ
    'JOEFS

    ʮσʢaVDʣʯͱ͍͏ϑΝΠϧΛ࡞੒͢ΔͱʮσʢaVDaVʣʯͱ͍͏ϑΝΠϧ͕ग़དྷ
    ্͕͍ͬͯΔɻ

    ˠ/'%Ͱม׵͞Ε͍ͯΔ
    UFSNJOBM

    UPVDIίϚϯυͰʮσʢaVDʣʯͱ͍͏ϑΝΠϧΛ࡞੒͢Δͱɺͦͷ··ͷʮσʢaVDʣʯ
    ϑΝΠϧ͕Ͱ͖Δɻ

    ˠม׵͞Ε͍ͯͳ͍

    View full-size slide

  9. "1'4͸ม׵Λ͠ͳ͍
    "1'4Ͱ͸ϑΝΠϧγεςϜϨΠϠʔͰ͸6OJDPEFਖ਼نԽΛ͍ͯ͠ͳ͍
    ೥ࠒ͔ΒNBDΛ࢝Ίଟ͘ͷ"QQMF੡඼Ͱ࠾༻͞Ε͍ͯΔ"1'4 "QQMF'JMF4ZTUFN
    ͸ɺϑΝΠϧ
    γεςϜϨΠϠʔͰ͸6OJDPEFਖ਼نԽΛ͠ͳ͍
    ͦΕ·ͰNBDͰ࠾༻͞Ε͍ͯͨ)'4Ͱ͸/'%Ͱਖ਼نԽ͞Ε͍ͯͨ
    )'4ˠ"1'4ͷҠߦظʹ͸ࠞཚ͕͋ͬͨΒ͘͠ɺਖ਼نԽͷҧ͏ϑΝΠϧΛࠞࡏͤ͞Δ͜ͱ͕Ͱ͖ͨ
    ˡҠߦظͷϑΝΠϧ
    ݟͨ໨͕ಉ໊ͷϑΝΠϧ͕ෳ਺͋ΓɺΧΦε
    ࢀߟIUUQTFDMFDUJDMJHIUDPBQGTJTDVSSFOUMZVOVTBCMFXJUINPTU
    OPOFOHMJTIMBOHVBHFT

    View full-size slide

  10. "1'4͸6OJDPEFਖ਼نԽΛ͠ͳ͍ͷͳΒɺಉ໊ʹݟ͑ΔϑΝΠϧΛ࡞ΕͪΌ͏Μ͡Όʁ
    ϥϯλΠϜਖ਼نԽʹΑΓɺಉ໊ʹݟ͑ΔϑΝΠϧ͸࡞Εͳ͍Α͏ʹͳ͍ͬͯΔ
    ݱࡏͷNBD04Ͱ͸࡞Εͳ͍Α͏ʹͳ͍ͬͯΔ
    NBD04Ҏ߱Ͱ͸ɺಡΈࠐΈ࣌ʹࢦఆ͞Εͨਖ਼نԽख๏ͷϑΝΠϧ͕ͳ͍৔߹ɺଞख๏Λࢼͯ͠
    ϑΝΠϧΛ୳͢ɺϥϯλΠϜਖ਼نԽ͕ߦΘΕ͍ͯΔɻ

    ʮσʢaVDʣʯͱ͍͏ϑΝΠϧ͕ͳ͍৔߹ɺʮσʢaVDaVʣʯ΋୳ͯ͘͠ΕΔɻ
    ॻ͖ࠐΈ࣌ʢϑΝΠϧ࡞੒࣌ʣʹ͸ਖ਼نԽ͠ͳ͍ͷͰͲͪΒͷܗࣜͷϑΝΠϧ΋࡞ΕΔ͕ɺ࡞੒લʹط
    ଘϑΝΠϧ͕ͳ͍͔ΛνΣοΫ͢Δɻ͜ͷͱ͖ʹϥϯλΠϜਖ਼نԽΛ࢖ͬͯطଘϑΝΠϧΛ୳͢ͷͰɺ
    ผख๏Ͱਖ਼نԽ͞ΕͨϑΝΠϧ໊͕͋Δ৔߹ɺϑΝΠϧ͸ͭ͘ΒΕͳ͍ɻˠಉ໊ʹݟ͑ΔϑΝΠϧ͸࡞
    ΒΕͳ͍ɻ

    View full-size slide

  11. ΞϓϦέʔγϣϯ͝ͱͷਖ਼نԽରԠ
    'JOEFS

    /'%ͳͷͰίʔυϙΠϯτͷҧ͏ϑΝΠϧ͸࡞੒ෆೳ
    NLEJS UPVDIίϚϯυ

    ਖ਼نԽͳ͠ͳͷͰҧ͏ίʔυϙΠϯτͷσΟϨΫτϦϑΝΠϧ΋࡞੒Մೳɻͨͩ͠࡞੒લʹϥϯλ
    ΠϜਖ਼نԽͰϑΝΠϧͷଘࡏ֬ೝ͕͋ΔͷͰɺಉ͡ʹݟ͑ΔσΟϨΫτϦΛॏෳͯ͠࡞੒͢Δ͜ͱ͸
    Ͱ͖ͳ͍ɻ
    NW DQίϚϯυ

    ࢀরϑΝΠϧΛϥϯλΠϜਖ਼نԽͰ୳ࡧ͢ΔɻͳͷͰ࣮ମϑΝΠϧ͕ͲͪΒͷਖ਼نԽͰ͋ͬͯ΋ࢀর
    Մೳɻ
    ҰํҠಈɾίϐʔઌϑΝΠϧ໊͸ਖ਼نԽ͞Εͳ͍ɻ͔͠͠Ҡಈɾίϐʔઌʹ͢ͰʹϑΝΠϧ͕͋Δ͔
    ͷνΣοΫ͸ϥϯλΠϜਖ਼نԽͰߦΘΕɺଘࡏ͍ͯ͠Ε͹ૢ࡞͸Ωϟϯηϧ͞ΕΔɻ

    View full-size slide

  12. ΞϓϦέʔγϣϯ͝ͱͷਖ਼نԽରԠ
    MTίϚϯυ

    NW DQͱಉ༷ͰϥϯλΠϜਖ਼نԽͰϑΝΠϧΛࢀর͢ΔͷͰɺ࣮ମϑΝΠϧ͕ͲͪΒͷਖ਼نԽͰ͋ͬ
    ͯ΋ࢀরՄೳ
    ྆ํͷਖ਼نԽΛࢦఆ͢Δͱ࣮ମ͸̍ϑΝΠϧͰ΋ͭ͋ΔΈ͍ͨʹݟ͑ΔͷͰࠞཚ͢Δ
    σʢaVDʣ σʢaVDaVʣ

    View full-size slide

  13. HJU͸/'$Ͱਖ਼نԽ
    HJU͸/'$Ͱ6OJDPEFਖ਼نԽ͍ͯ͠Δ
    HJU͸/'$Ͱ

    ʮσʯˠʮςʯʮʃʯˠʮσʯʹਖ਼نԽ͍ͯ͠Δ
    ͜Ε͸/'$ͳ-JOVYͳXJOEPXTͱͷؒͰ΋ϑΝΠϧͷ΍ΓऔΓΛ΍Γ΍͘͢͢ΔͨΊ͔ͱߟ͑ΒΕΔ
    DPSFQSFDPNQPTFVOJDPEFͷઃఆΛGBMTFʢHJUdͰ͸σϑΥϧτ͸USVFʣʹ͓ͯ͘͠ͱਖ਼نԽΛ
    ແޮԽͰ͖Δ

    View full-size slide

  14. 74$PEFͷਖ਼نԽରԠ͸ʁ
    74$PEFࣗ਎͸ਖ਼نԽ͠ͳ͍͕ɺϓϥάΠϯͰਖ਼نԽՄೳ
    74$PEFࣗମ͸ਖ਼نԽ͠ͳ͍ͷͰɺʮσʢaVDʣʯ΋ʮσʢaVDaVʣʯ΋ॻ͖෼͚͕Մೳ
    6OJDPEF/PSNBMJ[FSͱ͍͏ϓϥάΠϯΛ࢖͏͜ͱͰਖ਼نԽ͢Δ͜ͱ΋Մೳ

    View full-size slide

  15. QZUIPO͸
    QZUIPO͸/',$Ͱਖ਼نԽ͍ͯ͠Δ
    QZUIPOͰ͸ࣈ۟ղੳ࣌ʹɺ/',$ʢಉҰจࣈ൑ఆ͕ΏΔ͘ɺͱᶃͱ͔΋ಉҰͱΈͳ͢ख๏ʣ
    Ͱਖ਼نԽ͞Ε͍ͯΔ
    ͦͷͨΊɺʢ΍Βͳ͍ͱ͸ࢥ͏͕ʣม਺໊ΛʮσʢaVDʣʯͰʮσʢaVDaVʣʯ
    ॻ͖෼͚Δ͜ͱ͸Ͱ͖ͳ͍
    ·ͨɺ/'%Ͱ͋Δ'JOEFSͰ࡞੒ͨ͠ϑΝΠϧʮσʢaVDaVʣQZʯΛJNQPSU͢Δ͜
    ͱ΋Ͱ͖ͳ͍ɻ

    View full-size slide

  16. ରࡦ
    ໰୊HJUͰDPNNJUͨ͠ϑΝΠϧ໊ͱผϑΝΠϧʹهࡌ͍ͯ͠ΔϦϯΫ໊ͷਖ਼نԽख๏
    ͕ͣΕΔͱɺϦϯΫ͕ḷΕͳ͘ͳͬͯࠔΔ
    ରࡦ೔ຊޠ౳จࣈ߹੒ͷ΍΍͍͜͠ݴޠΛ࢖Θͳ͍
    ରࡦ$*ͰυΩϡϝϯτதͷจࣈྻΛਖ਼نԽ͢Δ
    ରࡦ74$PEFͷϓϥάΠϯͰखݩͰ΋ਖ਼نԽ͓ͯ͘͠

    View full-size slide