• Kojichan@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    3 months ago

    Usually only happened when a French person copied and pasted their text directly from a Word document… dang weird spaces and accented characters… drove my boss mad when I told him it was because it French, and not a glitch.

    Still had to work around it… text counters in textboxes had to account for accented characters, which took two bytes instead of one.

    “I only have 2000 letters!” … 2000 including 200 accent characters made it 2200 characters, not 2000.

    • AnUnusualRelic@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 months ago

      “I only have 2000 letters!” … 2000 including 200 accent characters made it 2200 characters, not 2000.

      Or, you could count it in Unicode characters, and not in whatever bizarro charset you’re using over there. Then “À” is one character, just as it’s supposed to be.

      The problem typically comes from improper conversion between charsets. Like Windows-1252 to Unicode, or something equally horrible.

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Not if the maximum is due to the database being configured to have a maximum space of 2000 bytes for that field.

      • Kojichan@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        I was basically calculating in Javavscript then in PHP for validation before I sent it to Zoho.

        The DB also was fine. It was honestly just PHP and Javascript. It’s all good now though!

    • calcopiritus@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Easy. Just use utf-32 and make the text field a maximum of 500 letters. That will be a maximum of 2000 bytes, doesn’t matter if the user is french or Chinese.

    • Hudell@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      I remember one day long ago when Notepad++ was the real shit, I was using the vertical selection feature and noticed that the selection was shorter on lines that had accented characters. I thought: “huh, accented characters count as two? What would happen if the selection ended in one? Can I select half a character?” no I could not and I had to restart my computer after trying.

      • Kojichan@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        I loved Notepad++.

        Started in DOS with Edit, regular notepad, got introduced to UltraEdit, then found NP++.

        … lol. Sounds like you tried splitting an atom.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 months ago

    I remember feeling extra powerful when Moonshell for the DS shipped with UTF-8 and UTF-16 support because the developer was japenese and wanted to make sure any language would work.

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    3 months ago

    my favorite thing to do is go to small town websites and look at the page source for their forms. 70% of the time they have inputs commented out to “disable” forms or just deprecated functionality.

    I like to uncomment them and submit the forms just to fuck with them 🤣

    • python@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      3 months ago

      I was applying to a job recently, and their online form had a “Upload your documents here” field. Problem was, the input was set to only accept a single file. Well, I wanted to upload two, so I just went into the html and added “multiple” to the input. Which just worked, I even checked the network tab to confirm that both files were submitted.
      Haven’t heard back from that company yet. It was a web dev position so I hope they appreciate my hijinks 🤞