encoding

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 34: invalid continuation byte

Deadly 提交于 2019-12-24 06:39:08
问题 I wanna open some text file in Persian language in python file with bellow code: for line in codecs.open('0001.txt',encoding='UTF-8'): lines.appends(line) but it gives me this error : > Traceback (most recent call last): File "/usr/lib/pycharm-community/helpers/pydev/pydevd.py", line 1596, in <module> globals = debugger.run(setup['file'], None, None, is_module) File "/usr/lib/pycharm-community/helpers/pydev/pydevd.py", line 974, in run pydev_imports.execfile(file, globals, locals) # execute

Maven jar plugin changes filenames (Encoding errors)

馋奶兔 提交于 2019-12-24 06:38:42
问题 Maven has issues encoding filenames with special characters in them. I have configured Maven to use UFT-8 encoding. The same special characters inside the files themselves do not change, they stay how they are supposed to be. Example Original file name: deniztürüç.xml File name in Maven's generated JAR: denizt├╝r├╝├º.xml File ID inside XML file: deniztürüç As you can see, only the file name changes. The same characters inside the file itself do not change. Can anybody explain why this is

What is a surrogate pair?

大憨熊 提交于 2019-12-24 05:36:08
问题 I came across this code in a javascript open source project. validator.isLength = function (str, min, max) // match surrogate pairs in string or declare an empty array if none found in string var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; // subtract the surrogate pairs string length from main string length var len = str.length - surrogatePairs.length; // now compare string length with min and max ... also make sure max is defined(in other words, max param is

What is a surrogate pair?

时光毁灭记忆、已成空白 提交于 2019-12-24 05:36:05
问题 I came across this code in a javascript open source project. validator.isLength = function (str, min, max) // match surrogate pairs in string or declare an empty array if none found in string var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; // subtract the surrogate pairs string length from main string length var len = str.length - surrogatePairs.length; // now compare string length with min and max ... also make sure max is defined(in other words, max param is

Where is the CLSID for Media Foundation H264 Encoder?

主宰稳场 提交于 2019-12-24 05:26:26
问题 The Media Foundation H264 Encoder MFT documentation does not mention a CLSID for the encoder. Other Encoder class IDs, and the H264 Decoder MFT class ID are defined at \Program Files (x86)\Microsoft SDKs\7.1\Include\wmcodecdsp.h or \Program Files (x86)\Windows Kits\8.x\Include\am\wmcodecdsp.h I see this codec when I enumerate the devices, and can obtain the CLSID, which is {6ca50344-051a-4ded-9779-a43305165e35}, from the enumerated list, but I cannot find a named GUID, which I would expect to

GStreamer: status of Python bindings and encoding video with mixed audio

别说谁变了你拦得住时间么 提交于 2019-12-24 05:23:07
问题 I am hoping to find a way to write generated video (non-real time) from Python and mix it with external audio file (MP3) simultaneously. What's the current status of GStreamer Python bindings, are they up-to-date? Would it be possible to write MPEG-4 output with GStreamer and feed raw image frames from Python Is it possible to construct pipeline so that GStreamer would also read MP3 audio and mix it into the container, so that I do not need to reprocess the resulting video track with ffmpeg

How can I use HTTParty with UTF-8 encoding?

余生长醉 提交于 2019-12-24 04:32:28
问题 I have a URL like http://example.com/tag/София/new.json and I want to make a GET request with HTTParty. When I do: HTTPArty.get "http://example.com/tag/София/new.json I get: URI::InvalidURIError at / bad URI(is not URI?): link here Any ideas how to handle this ? 回答1: The standard says "encode the URL as UTF-8, then represent multi-byte sequences as percent-escaped octets." In your case, http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json 来源: https://stackoverflow.com/questions

How can I use HTTParty with UTF-8 encoding?

邮差的信 提交于 2019-12-24 04:32:09
问题 I have a URL like http://example.com/tag/София/new.json and I want to make a GET request with HTTParty. When I do: HTTPArty.get "http://example.com/tag/София/new.json I get: URI::InvalidURIError at / bad URI(is not URI?): link here Any ideas how to handle this ? 回答1: The standard says "encode the URL as UTF-8, then represent multi-byte sequences as percent-escaped octets." In your case, http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json 来源: https://stackoverflow.com/questions

How can I use HTTParty with UTF-8 encoding?

房东的猫 提交于 2019-12-24 04:32:08
问题 I have a URL like http://example.com/tag/София/new.json and I want to make a GET request with HTTParty. When I do: HTTPArty.get "http://example.com/tag/София/new.json I get: URI::InvalidURIError at / bad URI(is not URI?): link here Any ideas how to handle this ? 回答1: The standard says "encode the URL as UTF-8, then represent multi-byte sequences as percent-escaped octets." In your case, http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json 来源: https://stackoverflow.com/questions

How do you troubleshoot character encoding problems?

♀尐吖头ヾ 提交于 2019-12-24 03:50:39
问题 If all you see is the ugly no-char boxes, what tools or strategies do you use to figure out what went wrong? (The specific scenario I'm facing is no-char boxes within a <select> when it should be showing Japanese chars.) 回答1: Firstly, "ugly no-char boxes" might not be an encoding problem, they might just be a sign you don't have a font installed that can display the glyphs in the page. Most character encoding problems happen when strings are being passed from one system to another. For