Is there a way to escape apostrophes?

Discussion in 'Empyrion API' started by Mortlath, Dec 30, 2017.

  1. Mortlath

    Mortlath Commander

    Joined:
    Jul 26, 2017
    Messages:
    49
    Likes Received:
    26
    When sending a chat command to a player the format is:
    "say p:{entityId} '{msg}' "

    However, if the message contains apostrophes, the message is truncated. Is there any way to fix that?
     
    #1
  2. jmcburn

    jmcburn Rear Admiral

    Joined:
    Jan 15, 2017
    Messages:
    1,110
    Likes Received:
    1,753
    Maybe try
    \'
    instead for apostrophes used in message. Could work, not sure though, depends a bit on the code. :)

    /jmc
     
    #2
  3. Mortlath

    Mortlath Commander

    Joined:
    Jul 26, 2017
    Messages:
    49
    Likes Received:
    26
    I know how to escape them in code. It's how to escape them in the command itself given back to the game.
     
    #3
  4. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Just use two of them, like '' to get '
     
    #4

Share This Page