Dendarii
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Val@lemm.ee to Programming@programming.devEnglish · 4 months ago

Can you use 0x1E-0x1F ASCII codes?

message-square
message-square
11
fedilink
27
message-square

Can you use 0x1E-0x1F ASCII codes?

Val@lemm.ee to Programming@programming.devEnglish · 4 months ago
message-square
11
fedilink

After needing to find a small delimiter for my data format I started wondering if I could use 0x1E-0x1F?

They are part of the control codes so I thought they might do something weird?

https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Field_separators

  • Dave.@aussie.zone
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    4 months ago

    consider what happens if the actual data contains them.

    Then you’d escape them by using another character in front. But if their data format is ASCII text or is guaranteed not to have characters below ASCII 32 then using ASCII delimiters is fine.

    • SpaceNoodle@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      4 months ago

      But who escapes the escape characters?

      • QuazarOmega@lemy.lol
        link
        fedilink
        arrow-up
        9
        ·
        4 months ago

        It’s escape characters all the way down

      • Val@lemm.eeOP
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        You can use Unicode pictures: ␜ ␝ ␞ ␟

        https://en.wikipedia.org/wiki/Control_Pictures

        • SpaceNoodle@lemmy.world
          link
          fedilink
          arrow-up
          7
          ·
          4 months ago

          Use emoji as escape characters

    • lurklurk@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      4 months ago

      Then you can just use a conmon delimiter like comma or semicolon or something. It’s better even as you’re less likely to have something that seems to work until your exotic delimiter pops up in the data.

      Better yet, use a commonly used data format like csv or json and don’t build your own

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      Indeed. Escape characters add a lot of additional complexity, footguns, and performance penalties.

Programming@programming.dev

programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 132 users / day
  • 1.05K users / week
  • 2.86K users / month
  • 7.11K users / 6 months
  • 1 local subscriber
  • 20.1K subscribers
  • 1.46K Posts
  • 19.8K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • MaungaHikoi@lemmy.nz
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org