0

Unicode support?

It's easy to add unicode support in the UI?

Normally we only write in english, but we have special character in our name and it doesn't show correctly in the UI (ex: é, è, ô)

댓글 7개

  • 0
    Avatar
    Manne Öhrström

    Hey there Mathieu!

    We have tried to address unicode in most of the engines already so you should hopefully be able to display and handle data in Nuke, Hiero etc. without any problems! Is this what you are seeing too? The outlier at the moment is Maya, where we have a fix for it but we haven't yet added it to the Toolkit engine.

    The good news is that there is a workaround that you can try in the meantime! Basically, the fix that we are thinking of putting in to the engine is to tell QT to assume cstrings are UTF-8 encoded, and this means that all data coming from shotgun (which delivers data as a UTF-8 byte stream) will be correctly formatted in the QT UIs. The reason we have been reluctant to put it into to the official engine distro up until this point is because it is a global change so it will affect everything in Maya. But we have several clients (on several locales) already running this patch so we are thinking that it is probably safe to add it to the engine at some point soon. In the meantime, try typing the following into the (python) script editor in maya after toolkit has launched but before you have opened any windows:

    from PySide import QtCore
    # tell QT to interpret C strings as utf-8
    utf8 = QtCore.QTextCodec.codecForName("utf-8")
    QtCore.QTextCodec.setCodecForCStrings(utf8)
    

    If that solves the issue, you can add that to your startup scripts (or into the toolkit init engine hook) as a workaround before we have released the proper fix. 

    Any probbs, let us know!

    Thanks!
    Manne

     

  • 0
    Avatar
    Mathieu Leblanc

    Thanks it work.  I'll add it in our pipeline

  • 0
    Avatar
    Mathieu Leblanc

    I still have a problem in snapshot history:

    The problematic string:

    ['<b>Version v033 at 08:49</b>', 'Created by Fr\xc3\xa9d\xc3\xa9rick', '<i>No description was entered for this snapshot</i>']

     

    # Traceback (most recent call last):
    # File "Y:\SGTK\studio\install\frameworks\app_store\tk-framework-widget\v0.1.19\python\browser_widget\browser_widget.py", line 320, in _on_worker_signal
    # self.process_result(data)
    # File "Y:\SGTK\studio\install\apps\app_store\tk-multi-snapshot\v0.2.11\python\tk_multi_snapshot\snapshot_list_view.py", line 139, in process_result
    # list_item.set_details(u"<br>".join(lines))
    # UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

    Any idea what is the best way to fix that?

     

    Thanks

  • 0
    Avatar
    Mathieu Leblanc

    In the .xml file:

      sg_user: {id: 72, name: !!python/str "Fr\xE9d\xE9rick Flamand", type: HumanUser}

     

    I don't understand why it's not that instead:

      sg_user: {id: 72, name: !!python/unicode "Fr\xE9d\xE9rick Flamand", type: HumanUser}

  • 0
    Avatar
    Alan Dann

    Hi Mathieu,

     

    > I don't understand why it's not that instead:

    >  sg_user: {id: 72, name: !!python/unicode "Fr\xE9d\xE9rick Flamand", type: HumanUser}

     

    It's because it's stored as utf8 encoded ascii rather than unicode.

    I thought this was working but it obviously isn't :(  

    I'll take a look and see if I can see where it's going wrong.

    Thanks

    Alan

     

  • 0
    Avatar
    Mathieu Leblanc

    At the moment it just seem to affect the username, we temporarily rename our 2 problematic users :)

  • 0
    Avatar
    Alan Dann

    Hi Mathieu,

    I've just release a new version (v0.12.13) of the Snapshot app to the app store which should fix the issue you found.

    Can you give it a go and let me know if you see any more problems?

    Thanks

    Alan

댓글을 남기려면 로그인하세요.