Jump to content
  • 0

Python script Help me please


Question

Posted

Hi MX members, i have a problem with the russian characters. I've a "change name" script as .py (python) file. Please tell me how can allow only English alphabetic chars? I need that code. Thank big!

Recommended Posts

  • 0
Posted
File "__init__.py", line 45, in onAdvEvent
LookupError: no codec search functions registered: can't find encoding

	at org.python.core.codecs.lookup(Unknown Source)
	at org.python.core.codecs.getEncoder(Unknown Source)
	at org.python.core.codecs.encode(Unknown Source)
	at org.python.core.PyString.str_encode(Unknown Source)
	at org.python.core.PyString.str_encode(Unknown Source)
	at org.python.core.PyString$1exposed_encode.__call__(Unknown Source)
	at org.python.core.PyObject.invoke(Unknown Source)
	at org.python.pycode.serializable._pyx1629403727261.onAdvEvent$3(__init__.py:45)
	at org.python.pycode.serializable._pyx1629403727261.call_function(__init__.py)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyFunction.__call__(Unknown Source)
	at org.python.core.PyMethod.__call__(Unknown Source)
	at org.python.core.PyObject.__call__(Unknown Source)
	at org.python.core.PyObject._jcallexc(Unknown Source)
	at org.python.core.PyObject._jcall(Unknown Source)
	at org.python.proxies.main$Quest$2.onAdvEvent(Unknown Source)
	at ru.catssoftware.gameserver.model.quest.Quest.notifyEvent(Unknown Source)
	at ru.catssoftware.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(Unknown Source)
	at ru.catssoftware.gameserver.network.clientpackets.RequestBypassToServer.runImpl(Unknown Source)
	at ru.catssoftware.gameserver.network.clientpackets.L2GameClientPacket.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Again(

5 minutes ago, melron said:

change the encode() to encode('utf-8') and check it

Can we redirect this error to any htmltext when the new name is with russian characters?

  • 0
Posted (edited)
6 minutes ago, dev951 said:

Can we redirect this error to any htmltext when the new name is with russian characters?

This is exactly what you asked at your main post :D.

 

try to import encodings

import encodings

 

if does not work too, you have two options.

 

  1. install python on your computer to have access at the encodings folder in order python will read them from your program files
  2. delete that script and do it via java
Edited by melron
  • 0
Posted
On 8/19/2021 at 11:17 PM, melron said:

This is exactly what you asked at your main post :D.

 

try to import encodings

import encodings

 

if does not work too, you have two options.

 

  1. install python on your computer to have access at the encodings folder in order python will read them from your program files
  2. delete that script and do it via java

I haven't encodings, when i type import e (here appears: import encode) and with that also doesn't works.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..