View Single Post
Old 15th September 2019, 08:27   #10  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by masterkivat View Post
Returning to this topic to ask a real question: I've been doing subs which have kanjis (example - .ass script) and both VSFilter/xy-VSFilter, along with the official subtitle plugin from VapourSynth, can't decode'em...


...am I doing something wrong or it can't really "decode" kanjis?
That problem is in your Python script. You need to use one of these:

- raw string where the backslash character is just another character with no special meaning:
Code:
dec = core.vsf.TextSub(dec, file=r"C:\Users\USER\Desktop\01-op.ass")
- regular string with escaped backslashes
Code:
dec = core.vsf.TextSub(dec, file="C:\\Users\\USER\\Desktop\\01-op.ass")
- regular string with forward slashes
Code:
dec = core.vsf.TextSub(dec, file="C:/Users/USER/Desktop/01-op.ass")
Because in regular strings the backslash is used to insert special characters like \n (new line), etc. and apparently Unicode stuff with \U.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline