character-encoding

Coverting unicode codeepoint format

北战南征 提交于 2019-12-24 21:10:46
问题 Let's say that I have a character string containing bytes representing an emoji: string <- "This is a test. U+1F600" How can I transform it into string <- "This is a test. \U0001F600" So that I can render it as utf8_print("This is a test \U0001F600") [1] "This is a test 😀​" 回答1: This is kind of a hack, but it works for your case: string <- c("This is a test. U+1F600", "Another test") # change U+XXXXYYYY to \UXXXXYYYY, quote and encode special characters expr <- gsub("U[+]([0-9A-Fa-f]{1,8})",

Autohotkey ComObjActive Outlook wrong encoding of umlauts

谁都会走 提交于 2019-12-24 20:16:04
问题 Currently i use Autohotkey to prefill Emails with Text and Attachments. tml_body= ( <html> <body> test </body> </html> ) m := ComObjActive("Outlook.Application").CreateItem(0) m.Subject := "subject with umlauts äüö " m.To := "foo@bar.com" m.CC := "foo@bar.com" m.HTMLBody := html_body m.Display ;m.attachments.add("filepath") WinWait Untitled - Message (HTML) WinActivate Untitled - Message (HTML) Using this script opens a new outlook mail with the following subject "subject with umlauts äüö

Russian input for word count

微笑、不失礼 提交于 2019-12-24 19:51:47
问题 Ok, so this is what I have (special thx to Tushar Gupta, for fixing the code) HTML <input type='checkbox' value='2' name='v'>STS <input type='checkbox' value='4' name='v'>NTV js $(function () { var wordCounts = {}; $("input[type='text']:not(:disabled)").keyup(function () { var matches = this.value.match(/\b/g); wordCounts[this.id] = matches ? matches.length / 2 : 0; var finalCount = 0; var x = 0; $('input:checkbox:checked').each(function () { x += parseInt(this.value); }); x = (x == 0) ? 1 :

Git messes up with non-ascii characters on Linux container

流过昼夜 提交于 2019-12-24 19:12:18
问题 I have a .Net Core (C#) project with the following line in one of the classes: var input = "£"; But when I do a git clone in a Docker container ( microsoft/dotnet:2.2-sdk ) it messes it up and displays it as � (in bash using cat ). And when I run it, its Utf-8 bytes are [239, 191, 189] = [EF, BF, BD] which seem to be a so-called Unicode replacement character. Windows editor that I use is VS 2017, but character is displayed properly on other windows machines and parsed properly by dotnet run

Design decision: Matching cyrillic chars in JSON with PHP

帅比萌擦擦* 提交于 2019-12-24 17:42:33
问题 I'm developing a plugin for a CMS and have an unanticipated problem: because the plugin is multilang-enabled, input can be of any of the unicode character sets. The plugin saves data in json format, and contains objects with properties value and lookup . For value everything is fine, but the lookup property is used by PHP to retrieve these entities, and at certain points through regexes (content filters). The problems are: For non-latin characters (eg. Экспорт), the \w (word-char) in a regex

Which character is used to fill contents of password text input?

喜夏-厌秋 提交于 2019-12-24 17:19:23
问题 I need this filled-circle character for my sketch of the UI. I have not found it in characters table on my mac. 回答1: I'm not sure which is the exact one on the mac, but bullet is probably what you want to search for. or use • unicode 2022. or alternatively ⚫ 26AB (medium black circle) or ● 25CF (black circle) 来源: https://stackoverflow.com/questions/3068199/which-character-is-used-to-fill-contents-of-password-text-input

Replace a string by character code instead of regex?

情到浓时终转凉″ 提交于 2019-12-24 17:19:19
问题 Does Java (or any other 3rd party lib) provide an API for replacing characters based on character code (within a known Charset of course) rather than a regex? For instance, to replace double quotes with single quotes in a given string, one might use: String noDoubles = containsDoubles.replace("\"", "'"); However the UTF-8 character code for a double quote is U+0022 . So is there anything that could search for instances of U+0022 characters and replace them with single quotes? Also, not just

Charset with Facebook SDK

女生的网名这么多〃 提交于 2019-12-24 16:41:16
问题 I needed to work with Facebook SDK, so with some help, I wrote script that can find informations about person. But if there is diacritic in his/her name, it will be malformed, I tried to set charset in SDK files, but it doesn't help. For example, if the name is René Beneš, it will be RenĂ© Beneš. Can you help me please? Thank you 回答1: I can describe, at the character level, what is going on here – I hope it helps you closer to a solution. You apparently get the data in UTF-8 encoding, but

Displaying UTF8 stings in Ubuntu's terminal with a Python script

亡梦爱人 提交于 2019-12-24 16:20:06
问题 In my Python script running at the command line on Ubuntu, it's selecting UTF8-encoded content from a MySQL database. Then, I want to print the string to the console. The displayed strings have an encoding problem, as they don't show the accented characters correctly. How do I fix this? Preferably, the script would make the decision, rather than setting a system environment, to ensure easy running on other systems. 回答1: It is very strongly recommended that you not use "?" as a replacement

Getting different encryption results between C#.Net and Oracle

♀尐吖头ヾ 提交于 2019-12-24 15:06:27
问题 I want to encrypt some strings based on SHA1 algorithm in both C#.Net and Oracle 10g. My algorithm in C#.Net: string salt = "123"; System.Security.Cryptography.SHA1 sha = System.Security.Cryptography.SHA1.Create(); byte[] preHash = System.Text.Encoding.UTF32.GetBytes(salt); byte[] hash = sha.ComputeHash(preHash); string password = System.Convert.ToBase64String(hash); password = password.Substring(0, 8); // password value is: "7yP7/lkJ" In Oracle: Create Or Replace Function Sha1(P_Value