Forum Discussion

Manfred_F's avatar
Manfred_F
Regular Contributor
8 years ago

aqString.Compare with german Umlaut

.. is not, what I would expectn (TC V11.2),

aqString.Compare("Energiezähler", "ENERGIEZÄHLER", false) <> 0?

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    Not sure, what you are asking.

     

    aqString.Compare("Energiezähler", "ENERGIEZÄHLER", false) 

     

    above line will return 0 if both values matched.


    From TC docuement:

     

    Result Value

    Integer value that indicates the comparison result. The following values are possible:

    Value Meaning
    -1 The String1 is less than String2.
    0 The String1 identical to String2.
    1 The String1 is greater than String2.

    https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/compare.html

    • Manfred_F's avatar
      Manfred_F
      Regular Contributor

      To be more precise, I get the Result 1, not 0.

      When I remove the "Ä"/ "ä", there is the 0, as expected.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I have the following code (in JScript):

        function test3() {
            Log.Message(aqString.Compare('Energiezähler','ENERGIEZÄHLER', false));
        } 

        And this is returning a 0 as expected.  I'm running TC 12.30.  I don't have 11.2 installed to verify.  It's possible that better support for extended ASCII within the aqString object may be included in later versions.  I'd suggest you send this query off to the support team directly.