Page 1 of 1

Encoding error using get_key_value_string

Posted: Sat May 30, 2015 1:16 am
by _Ododo_
Hello, i'm new to SP
I encounter a UTF-8 encoding error when using BaseEntity.get_key_value_string (btw it shouldn't be a method of Edict class as specified in the Wiki ?)

Here is the traceback:

Syntax: Select all

from entities.helpers import create_entity, spawn_entity
from entities.entity import BaseEntity
...

env_mic_i = create_entity('env_microphone')
env_mic = BaseEntity(env_mic_i)
#env_mic.set_key_value_string('Name', 'heythere')
spawn_entity(env_mic_i)
a = env_mic.get_key_value_string('Name')


a = env_mic.get_key_value_string('Name')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdd in position 1: invalid continuation byte

What am i doing wrong ?

ty !

Posted: Sat May 30, 2015 1:23 am
by _Ododo_
Sorry i found that i needed to use 'Targetname' instead of 'Name', i would be great to handle bad key requests in SP 's code.

Posted: Sat May 30, 2015 1:27 am
by L'In20Cible

Posted: Sat May 30, 2015 1:31 am
by _Ododo_

Posted: Sat May 30, 2015 1:43 am
by L'In20Cible

Posted: Sat May 30, 2015 1:49 am
by _Ododo_

Posted: Thu Jun 11, 2015 5:23 pm
by L'In20Cible
En fait, j'avais parler trop vite. Je viens d'ajouter une exception lorsque le nom n'est pas valide: 5f5503b