cjk

Display japanese Text with furigana in UILabel

天涯浪子 提交于 2019-12-02 12:24:39
for my app, few month ago, i've take the code from this site to use CTRubyAnnotation. This code, with few changes to make work with swift 4, work perfectly. from this work I've create a class in which I written a function to use that code. this is the class in swift 4 import UIKit extension String { func find(pattern: String) -> NSTextCheckingResult? { do { let re = try NSRegularExpression(pattern: pattern, options: []) return re.firstMatch( in: self, options: [], range: NSMakeRange(0, self.utf16.count)) } catch { return nil } } func replace(pattern: String, template: String) -> String { do {

HEX String to Chinese String

China☆狼群 提交于 2019-12-02 11:35:51
问题 I have the following code to convert from HEX to ASCII. //Hexadecimal to ASCII Convertion private static string hex2ascii(string hexString) { MessageBox.Show(hexString); StringBuilder sb = new StringBuilder(); for (int i = 0; i <= hexString.Length - 2; i += 2) { sb.Append(Convert.ToString(Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)))); } return sb.ToString(); } input hexString = D3FCC4A7B6FABBB7 output return = Óüħ¶ú»· The output that I

Unicode printing on a PRINTER in VB6

假装没事ソ 提交于 2019-12-02 07:53:39
I'm trying to print a Unicode (Chinese) string on a printer (well, actually PDFCreator) but all I get is a VERTICAL print of the characters. I use the TextOutW function imported from gdi32.dll : TextOutW dest.hDC, x, y, StrConv(szText, vbUnicode), Len(szText) And if I try to print "0.12" (if I print Chinese characters, I get the same result anyway), I get 0 . 1 2 If I use the dest.Print function, I am not able to print Unicode. Anyway, TextOutW works WONDERFULLY on the screen. Can anyone help me solve this? What is the definition of szText ? Is it a VB6 string? In which case try Private

Unicode characters necessary for Japanese, Korean, and Chinese

和自甴很熟 提交于 2019-12-02 05:59:53
I'm trying to answer these basic questions without getting a degree in linguistics and early human history, which seems to be where every google search has lead. Which unicode characters are necessary to include in a font in order to support rendering of Japanese language text? Which unicode characters are necessary to include in a font in order to support rendering of Chinese language text? Which unicode characters are necessary to include in a font in order to support rendering of Korean language text? Start with the East Asian Scripts in the Code Charts @ unicode.org . For example, Hiragana

HEX String to Chinese String

我的梦境 提交于 2019-12-02 05:47:28
I have the following code to convert from HEX to ASCII. //Hexadecimal to ASCII Convertion private static string hex2ascii(string hexString) { MessageBox.Show(hexString); StringBuilder sb = new StringBuilder(); for (int i = 0; i <= hexString.Length - 2; i += 2) { sb.Append(Convert.ToString(Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)))); } return sb.ToString(); } input hexString = D3FCC4A7B6FABBB7 output return = Óüħ¶ú»· The output that I need is 狱魔耳环, but I am getting Óüħ¶ú»· instead. How would I make it display the correct string? Tim S.

Write Chinese chars to a text file using vbscript

蹲街弑〆低调 提交于 2019-12-01 21:38:12
I'm trying to write some Chinese characters to a text file using Set myFSO = CreateObject("Scripting.FileSystemObject") Set outputFile = myFSO.OpenTextFile(getOutputName(Argument, getMsiFileName(Wscript.Arguments)), forWriting, True) outputFile.WriteLine(s) The variable s contains a Chinese character that I read from the other file. I echo s value and I can see the s correctly in the screen. However, for some reason the script stops running after outputFile.WriteLine(s) without returning any error message. Am I missing something? Helen Maybe it's got something to do with character encoding.

Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit)

南楼画角 提交于 2019-12-01 17:49:42
I checked MSDN and the locale string is zh_Hant, but I also tried with zh_TW (Chinese, Taiwan). The traditional Chinese characters look OK in the poEditor, but when I open the file in the browser the characters are just weird symbols («¢Åo¥@¬É!). I think the translation is working, but there's something wrong with the encoding (I used UTF-8 for both Charset and Source Code Charset). The files generated with poEditor: messages.po: msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-02-15 16:26+0800\n" "PO-Revision-Date: 2010-02-15 16:26+0800\n" "Last

Why can't I write Chinese characters in nodejs HTTP response?

可紊 提交于 2019-12-01 17:07:25
Here is my little code: var http = require('http'); var port = 9002; var host_ip = '<my_ip>'; http.createServer(function (req, res) { var content = new Buffer("Hello 世界", "utf-8") console.log('request arrived'); res.writeHead(200, { 'Content-Encoding':'utf-8', 'charset' : 'utf-8', 'Content-Length': content.length, 'Content-Type': 'text/plain'}); res.end(content.toString('utf-8'),'utf-8'); }).listen(port, host_ip); console.log('server running at http://' + host_ip + ':' + port); Previously I just let res.end to send "hello world" and it worked well. Then I wanted to adjust a little bit and

Why can't I write Chinese characters in nodejs HTTP response?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 15:02:31
问题 Here is my little code: var http = require('http'); var port = 9002; var host_ip = '<my_ip>'; http.createServer(function (req, res) { var content = new Buffer("Hello 世界", "utf-8") console.log('request arrived'); res.writeHead(200, { 'Content-Encoding':'utf-8', 'charset' : 'utf-8', 'Content-Length': content.length, 'Content-Type': 'text/plain'}); res.end(content.toString('utf-8'),'utf-8'); }).listen(port, host_ip); console.log('server running at http://' + host_ip + ':' + port); Previously I

Reading Chinese character from .csv file in C/C++

懵懂的女人 提交于 2019-12-01 13:22:11
I have a .csv file with chinese characters. I need to read in these chinese characters and store them for further use in the program. I know that chinese characters have to be processed in utf format, using wchar_t and the like, but I am not able to figure out exactly how this is to be done. Can anyone please help me out? First of all, there is no unique way to encode Chinese characters. To be able to decode the file, you first have to know which encoding has been used. The most common ones are utf-8, utf-16, big5 and gb2312. gb2312 is for simplified characters and mostly used in mainland