Questions tagged [unicode-escapes]

Use this tag for questions related to Unicode Escapes, a Unicode character Escape sequence represents a Unicode character.

Quoting the MSDN page:

A Unicode escape sequence represents the single Unicode character formed by the hexadecimal number following the "\u" or "\U" characters. Since C# uses a 16-bit encoding of Unicode code points in characters and string values, a Unicode character in the range U+10000 to U+10FFFF is not permitted in a character literal and is represented using a Unicode surrogate pair in a string literal. Unicode characters with code points above 0x10FFFF are not supported.

Notice that is used in its general meaning, thus you are encouraged to tag your question with the corresponding programming environment as well.

318 questions
2
votes
1 answer

Sending unicode data for POST request through Java client results in?

I am attempting a invoke an SMS sending API through a java client in my spring boot application. Following is the code I am using. HashMap requestParameters = new HashMap<>(); requestParameters.put("user_name",…
2
votes
2 answers

How can I render unicode in javascript using a variable?

It works when I just use a string directly, but not with a variable. Works console.log(`\u{1F436}`); Doesn't Work const unicode = '1F436'; console.log(`\u{ ${unicode} }`); I get this error: Parsing error: Invalid escape sequence in…
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59
2
votes
0 answers

Invalid Unicode Escape Sequence with correct syntax (JS)

I have some code like this: str = "" for (var i = 0; i < 5; i++) str += eval("'\\u" + Math.floor(Math.random() * 65536).toString(16) + "'") Occasionally when this is ran in a console, an Uncaught SyntaxError: Invalid Unicode escape sequence occurs.…
user11214808
2
votes
1 answer

How to decode escape sequence in string written in decimal properly

I have a piece of code that contains strings with UTF-8 escape sequences written in decimal, such as my_string = "Hello\035" which should be then interpreted as Hello# I don't mind parsing the decimal value, so far I've used things like this for…
Saeko
  • 421
  • 1
  • 4
  • 14
2
votes
2 answers

Need to process the Kannada language(Regional) in Python 3.7 without Encoding Issues

There is a JSON file with Kannada letters in it. Info.json { "name":"", "url":"", "desc":"ಹಾಡುಗಳನ್ನು ಈಗ ಆನಂದಿಸಿ." } If i try to read this file without encoding like with open('info.json', 'r') I get Error: 'charmap' codec can't decode…
hondvryer
  • 442
  • 1
  • 3
  • 18
2
votes
1 answer

Python 3 unicode-escape

I have a script that I built following the blueprint in the book Learning Python for Forensics. The script will go through a directory specified by the user and collect the metadata for each file in the directory. The results are saved to a sqlite…
2
votes
1 answer

What's the difference between "\x85" and "\u{85}" in Crystal?

I know \u{...} can be used to specify a unicode codepoint in hexadecimal. However, "\x86" != "\u{86}". But, "\x7F" == "\u{7F}". What's the difference between the \x and \u escape sequences?
dgo.a
  • 2,634
  • 23
  • 35
2
votes
1 answer

Escape Unicode in Android OnTextChanged event :Like "price:10rs" to "\u0070\u0072\u0069\u0063\u0065\u003A\u0031\u0030\u0072\u0073"

How can I escape any Unicode in android OnTextChanged event?? Like "price" to "\u0070\u0072\u0069\u0063\u0065". I tried it but I cant find any solution. This is my textwatcher price.addTextChangedListener(new TextWatcher() { public…
user1992
  • 176
  • 10
2
votes
1 answer

Unicode text converted into decimal- Blogger

I'm trying to share some Malayalam text to Facebook feed dialog via Blogger but I'm facing some problem. Here's the issue. I'm using the feed dialog code directly in the HTML part of the blog post and because of that, the final text is automatically…
Arun Kumar
  • 23
  • 2
2
votes
4 answers

Remove \u from string?

I have a few words in a list that are of the type '\uword'. I want to replace the '\u' with an empty string. I looked around on SO but nothing has worked for me so far. I tried converting to a raw string using "%r"%word but that didn't work. I also…
Clock Slave
  • 7,627
  • 15
  • 68
  • 109
2
votes
1 answer

Convert Strings to Character Escapes and Unicode without StringEscapeUtils

I'm doing some regex to split some Strings and extract both Unicode and normal escapes out of them (basically any escape accepted by Java), and then I want to parse them through a method. This all works fine, however now I am at the point where once…
user5549921
2
votes
2 answers

How can I get python ''.encode('unicode_escape') to return escape codes for ascii?

I am trying to use the encode method of python strings to return the unicode escape codes for characters, like this: >>> print( 'ф'.encode('unicode_escape').decode('utf8') ) \u0444 This works fine with non-ascii characters, but for ascii…
reynoldsnlp
  • 1,072
  • 1
  • 18
  • 45
2
votes
1 answer

How to search the MySQL entries shown as decimal numeric character reference(NCR) &#xxxxx?

When I am searching my MySQL database with some query like: SELECT * FROM mytable WHERE mytable.title LIKE '%副教授%'; ("副教授" are three Chinese characters, whose decimal numeric character reference, NCR, is "副教授"), I got no result.…
YNG
  • 88
  • 1
  • 7
2
votes
2 answers

escape characters and strings

I have a function that goes as: def set_localrepo(self): stream = open("file1.yml", "r") results = yaml.load(stream) run_cmd = results["parameters"]["tag"]["properties"] config_list = ( 'sleep 200', '[sh, -xc, \"echo test\' test\'…
AB2328
  • 79
  • 2
  • 10
2
votes
1 answer

Escape Characters in JSON Data

I start with mentions = GET(final_url, sig) json = content(mentions) My code crashes at the next line which is json2 = jsonlite::fromJSON(toJSON(json)) Giving error... Error: lexical error: invalid character inside string. …
Jibril
  • 967
  • 2
  • 11
  • 29