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

Unicode & Swift Strings

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Unicode & Swift Strings

Ven a conocer cómo la computadora sabe mostrar tu emoji favorito 😏
Cómo podemos hacer que nuestro Software funcione para diversos idiomas (incluyendo el idioma que está dominando la comunicación humana: emojis)
Luego aprenderemos cómo poner esto en práctica con Swift, un lenguaje que tiene uno de los mejores manejos de Strings y veremos por qué.

Avatar for Jhonny Bill

Jhonny Bill

April 10, 2019

Other Decks in Programming

Transcript

  1. ةيبرعلا Հայերեն ⽩白语 Euskara 廣東話 Català ᏣᎳᎩ 中⽂文 华语 汉语

    ⽂文 ⾔言 Čeština Dansk English Esperanto Français Galego Deutsch Ελληνικά Kreyòl Ayisyen תירבע िहन्दी िहन्दी Bahasa Indonesia Gaeilge Italiano ⽇日本語 ೠҴয 國語 polszczyzna Português Русский དbuས་skད་ དbuས་skད་ Español Lingua Latina Afrikaans
  2. Alfabetos Consonante o vocal Latín, griego… Abuguidas Unión consonante-vocal Telugu…

    Silabarios Sílaba Japonés, ᏣᎳᎩ… Abyades Consonantes Hebreo, Árabe… Logogramas Palabra Chino tradicional… Ideogramas Idea ✨
  3. 200 11001000 1,500,000 101101110001101100000 Binario Sistema numérico de 2 dígitos.

    2⁷ 2⁶ 2⁵ 2⁴ 2³ 2² 2¹ 2⁰ 128 64 32 16 8 4 2 1
  4. 9 1001 2⁰ + 2³ 1 + 0 + 0

    + 8 13 1101 2⁰ + 2² + 2³ 1 + 4 + 8 Binario Sistema numérico de 2 dígitos. 2⁷ 2⁶ 2⁵ 2⁴ 2³ 2² 2¹ 2⁰ 128 64 32 16 8 4 2 1
  5. Hexadecimal Sistema numérico de 16 dígitos. 200 11001000 C8 1,500,000

    101101110001101100000 16E360 0 1 2 3 4 5 6 7 8 9 A B C D E F 00 00 00 01 00 10 00 11 01 00 01 01 01 10 01 11 10 00 10 01 10 10 10 11 11 00 11 01 11 10 11 11
  6. ASCII 8 Bits = 00000000 = 2⁸ = 256 7

    Bits = 0000000 = 2⁷ = 128
  7. Plano 0 U+0000 - U+FFFF Basic Multilingual Plane Latín, CJK…

    Plano 1 U+10000 - U+1FFFF Supplementary Multilingual Plane Plano 2 U+20000 - U+2FFFF Supplementary Ideographic Plane CJK Plano 3 - 13 U+30000 - U+DFFFF Plano 14 U+E0000 - U+EFFFF Supplementary Special-Purpose Plane Carácteres no gráficos Plano 15 - 16 U+F0000 - U+10FFFF Private Use Area  䢥 ⏏ *↖ #
  8. Swift “0”.count 1 Python len(“0”) 7 Rust String::from(“0”).len() 25 JS

    “0”.length 11 C++ string str = “0” str.size() 25
  9. Swift “\u{0061}\u{0301}" == "\u{00E1}" TRUE Python \u0061\u0301' == '\u00E1' FALSE

    Rust String::from("\u{0061}\u{0301}") == String::from("\u{00E1}") FALSE JS "\u0061\u0301" == “\u00E1" FALSE C++ str1.compare(str2) == 0 FALSE á == á
  10. I

  11. T