5

I'm using Sabre web services (SabreCommandLLSRQ) to build a c# proof of concept for low fare re-booking.

I'm now hitting some special sabre characters that I don't know what they are in c#. I have a few that are working but I'm sure to encounter more - does anybody have a sabre character mapping for c#?

private string BuildPriceLine()
{
    const char CHLOR = (char)0xE7;   // Cross-of-Lorraine
    const char ENDITEM = (char)0xA7; // End Item key
    const char CHGKEY = (char)0xA5;  // Change Key

    var sabreCommand = new StringBuilder();

    // WPRQ‡AAA‡UN*C123456‡KP0‡XP«
    sabreCommand.Append("WPRQ");
    sabreCommand.Append(CHLOR);
    sabreCommand.Append("AAA");
    sabreCommand.Append(CHLOR);
    sabreCommand.Append("UN*C123456");
    sabreCommand.Append(CHLOR);
    sabreCommand.Append("KP0");
    sabreCommand.Append(CHLOR);
    sabreCommand.Append("XP");
    sabreCommand.Append(WhatSabreCharIsThis); // "«" ?

    return sabreCommand.ToString();
}
fuchs_tx
  • 135
  • 1
  • 6
  • Sabre character set https://sds.sabre.com/XTRANET_Access/sabre.htm – Shar1er80 Aug 02 '15 at 22:56
  • I ran across this character set a while back. I could not get any relevant items to play nice using them in c# and passing into the SabreCommandLLSRQ. – fuchs_tx Aug 02 '15 at 23:23
  • 3
    I think '«' is just an end of line / return character - not something you'd pass as part of your SabreCommandLLSRQ – Pj. Aug 03 '15 at 06:24
  • Just to confirm these are the only 3 special characters I've encountered needed to be used when working with the Sabre API in the 8 years I've been working with their web service. The next challenge will be dealing with those special characters in an XML response from the sabre webservice to a .Net application. Watch out for the invisible characters. – Mr Harno Jul 22 '16 at 08:37
  • As best practices by Sabre you should avoid to use SabreCommand in your API's, you should use a webservice to perform this transaction – Mr Milk Jul 02 '19 at 16:24

3 Answers3

5

When you want to insert special Sabre characters in your XML, this is what I've got documented for Sabre Web Services SabreCommandLLSRQ service:

<!--Use &#231; for Cross of Lorraine-->
<!--Use &#164; for Change-->
<!--Use &#167; for End Item-->

Cross of Lorraine is the most commonly used one, but End Item and Change are also used.

Xansta
  • 87
  • 1
  • 4
3

Pj is correct. When you hit 'Enter' in the terminal window to send that command as an agent would that character appears. Don't include it with your request.

TravelDev
  • 102
  • 1
  • 10
0

SabreCommandLLSRQ response returns damaged by double encoding string (from Sabre + our Java WS framework side). For Java I have:

public static String decode(String termRsp) {
    try {
        String fromUtf8 = new String(termRsp.getBytes("ISO-8859-1"), "UTF-8");
        String fromLatin1 = new String(fromUtf8.getBytes("ISO-8859-1"), "windows-1252");
        return fromLatin1;
    } catch (UnsupportedEncodingException e) {
        return termRsp;
    }
}

It seems many Windows code page encodings are fine for final conversion. They have dagger ‡ / yen ¥ / currency ¤ / section § signs in the same code positions:

Correspondence between Sabre encoding and cp1252 can be seen in https://sds.sabre.com/XTRANET_Access/sabre.htm (in ALT Entry).

gavenkoa
  • 45,285
  • 19
  • 251
  • 303