big5

How to use Big5 encoding in Swift on iOS

烂漫一生 提交于 2019-12-24 09:50:12
问题 I'm scanning a QR-Code with chinese characters encoded in Big5. (主页概况) Is there a chance to get this String decoded correctly in Swift 3? I found this Objective-C example on GitHub and this SO question, but there are no kCFStringEncodingBig5_HKSCS_1999 and kCFStringEncodingBig constants in Swift. Update: I found the corresponding swift variables, so i now tried the following: func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from

Check if a character is Traditional Chinese in Big-5 (Java)?

萝らか妹 提交于 2019-12-24 04:46:26
问题 I have a thermal printer, which supports only Traditional Chinese characters other than Latin. Is there any way to check, that given a CJK character in Unicode, whether it is a valid Traditional Chinese character under Big-5 encoding? UPDATE Here is the method I'm using to check if a String has Unicode CJK. public static boolean isChineseText(String s) { for (int i = 0; s != null && s.length() > 0 && i < s.length(); i++) { char ch = s.charAt(i); Character.UnicodeBlock block = Character

iOS: What's the best way to detect a file's encoding

纵饮孤独 提交于 2019-12-22 13:50:06
问题 In some cases, I really need to know a file's encoding while reading the file. Sometimes we can do as Apple's String Programming Guide suggest : Reading data with an unknown encoding If you find yourself with text of unknown encoding, it is best to make sure that there is a mechanism for correcting the inevitable errors. For example, Apple's Mail and Safari applications have encoding menus, and TextEdit allows the user to reopen the file with an explicitly specified encoding. If you are

CA2W gave me a “'AtlThrowLastWin32': identifier not found” error

流过昼夜 提交于 2019-12-12 12:18:34
问题 I got a strange compilation error when I followed the MSDN document to use CA2W to convert big5 strings to unicode strings in Visual Studio 2005. This is the code I wrote: #include <string> #include <atldef.h> #include <atlconv.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string chineseInBig5 = "\xA4\xA4\xA4\xE5"; ATL::CA2W(chineseInBig5.c_str()); return 0; } The compilation error: error C3861: 'AtlThrowLastWin32': identifier not found I don't know how this could happen. The

How to parse non-UTF8 XML in browsers with Javascript?

久未见 提交于 2019-12-10 23:25:09
问题 I have a XML string encoded in big5: atob('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iYmlnNSIgPz48dGl0bGU+pKSk5TwvdGl0bGU+') ( <?xml version="1.0" encoding="big5" ?><title>中文</title> in UTF-8.) I'd like to extract the content of <title> . How can I do that with pure Javascript in browsers? Better to have lightweight solutions without jquery or emscripten. Have tried DOMParser : (new DOMParser()).parseFromString(atob('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iYmlnNSIgPz48dGl0bGU+pKSk5TwvdGl0bGU+'),

how to get big5 urlencode in node.js?

旧时模样 提交于 2019-12-10 11:35:52
问题 I want to use nodejs to encode the char '十'(\u5341) to big5 '%A4Q', but I don't know how to do it. I need help. More detail, bellow is a html file names test.html: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>test</title> </head> <body> <form> <input name="a"/> <input type="submit"> </form> </body> </html> And open this file in Chrome, type '十' and click 'Submit', you can see the url in the address bar is ' http://localhost/test.html

how to get big5 urlencode in node.js?

筅森魡賤 提交于 2019-12-06 15:43:29
I want to use nodejs to encode the char '十'(\u5341) to big5 '%A4Q', but I don't know how to do it. I need help. More detail, bellow is a html file names test.html: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>test</title> </head> <body> <form> <input name="a"/> <input type="submit"> </form> </body> </html> And open this file in Chrome, type '十' and click 'Submit', you can see the url in the address bar is ' http://localhost/test.html?a=%A4Q '. I just want to use nodejs to convert url same as Chrome(and other browsers). I tried to use