Data360 Analyze

 View Only
  • 1.  Swedish characters encoding

    Posted 03-14-2023 07:24

    Hello, how do i handle characters like Å Ä Ö in Data 360?

    In my example i am creating them in a transform node:

    Configure fields:

    out1.A = str

    ProcessRecords:

    If condition 1:

         out1.A = ' Väster'

    I get the result  "Väster"

    For out1.A = "Öster" i get Öster

    I have tried making the data type unicode but same result



    ------------------------------
    Henrik B
    E.ON Sverige
    ------------------------------


  • 2.  RE: Swedish characters encoding

    Employee
    Posted 03-14-2023 10:15

    There are two issues.

    The first is that Python 2 requires you to create a unicode string explicitly. This can be achieved by prefixing the string value with u e.g. u'Väster'  

    The second is that you cannot use a 'str' type field to store a unicode value - a 'str' type field can only store ASCII values. We recommend you define text fields as 'unicode' type unless there is a specific reason for using the 'str' type field.



    ------------------------------
    Adrian Williams
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Swedish characters encoding

    Employee
    Posted 03-14-2023 10:18

    You can also create a unicode string using the unicode() constructor, e.g.   value2 = unicode("Öster","utf-8")



    ------------------------------
    Adrian Williams
    Precisely Software Inc.
    ------------------------------