on 2020 Jan 08 4:29 AM
1. Operator
2. Pipeline
3. Result(Error)
4. Question
Why is there a decode error?
And what is the solution
Below is the code.
The question is simple.
How should I print out korean?
I've tried most of what Google has found, but I failed.
#code
#coding=utf-8
result = "한글 출력 테스트"
result = result.decode('utf8').encode('utf8')
api.send("outstr", result)
Request clarification before answering.
As far as I know in Python3 all strings are already Unicode. So if I run simple
result = "한글 출력 테스트"
api.send("outstr", result)
with
I am getting a result in Wiretap
Here is a complete graph JSON, if you want to run the same:
{
"properties": {},
"description": "Encode Korean",
"processes": {
"python3operator1": {
"component": "com.sap.system.python3Operator",
"metadata": {
"label": "Python3Operator",
"x": 12,
"y": 12,
"height": 80,
"width": 120,
"extensible": true,
"config": {
"script": "result = '한글 출력 테스트'\napi.send(\"outstr\", result)"
},
"additionaloutports": [
{
"name": "outstr",
"type": "string"
},
{
"name": "outblob",
"type": "blob"
}
]
}
},
"wiretap1": {
"component": "com.sap.util.wiretap",
"metadata": {
"label": "Wiretap",
"x": 196.99999904632568,
"y": 12,
"height": 80,
"width": 120,
"ui": "dynpath",
"config": {}
}
}
},
"groups": [],
"connections": [
{
"metadata": {
"points": "136,43 163.99999952316284,43 163.99999952316284,52 191.99999904632568,52"
},
"src": {
"port": "outstr",
"process": "python3operator1"
},
"tgt": {
"port": "in",
"process": "wiretap1"
}
}
],
"inports": {},
"outports": {}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
54 | |
6 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.