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
3
votes
2 answers

Visual Studio C++ preprocessor-define fails with path starting on "u"

That's right I want to supply a path as preprocessor define (properties->configuration->c/c++->preprocessor) MY_PATH=c:\$(WindowsSdkDir)\um But this hits me upon use with E1696 cannot open source file "C:\asdf\u0000m\xyz.h" E0992 command-line…
3
votes
2 answers

Regex to match emojis that can be validly combined with skin tone modifiers?

The JS code to detect emojis (in the usual sense of the term "emoji") is simply: let str = "..."; if(/\p{Extended_Pictographic}/u.test(str)) { // do something } Is there some equivalently simple way to detect emojis that can have skin tone…
joe
  • 3,752
  • 1
  • 32
  • 41
3
votes
2 answers

Testing for a feature of regex compilation in IE11

I would like to test for Unicode Regex Property Escapes to avoid compiling a broken regular expression in browsers that do not support it (for example IE11). Ideally, I'd like to write something along the lines of: if (regex supports unicode…
3
votes
3 answers

Why is my program being interferred by comments?

Our tasks at school is to add a test example of the program at the bottom of the code with: #example """ """ but when I do so, I get error. I never get it on any other codes, only on this…
3
votes
4 answers

convert decimal value to unicode characters in php

i need to convert decimals values into unicode and display the unicode character in PHP. so for example, 602 will display as this character: ɚ after referencing this SO question/answer, i was able to piece this together: echo json_decode('"' .…
edwardsmarkf
  • 1,387
  • 2
  • 16
  • 31
3
votes
1 answer

Why is unicode encoded differently in these two scenarios?

I have written this minimal example: public static class X { private String x; public String getX() { return x; } public void setX(String x) { this.x = x; } public X(String x) { super(); …
Alex R
  • 11,364
  • 15
  • 100
  • 180
3
votes
1 answer

Alternative of ChrW function

Is there any alternative function/solution of the ChrW() which accepts value not in range is -32768–65535 like for character code 􀂇 which leads to "". Using ChrW() gives error "Invalid procedure call or argument" So I want an alternative…
mrinali
  • 140
  • 10
3
votes
2 answers

Unicode surrogate pairs and String.fromCodePoint() — JavaScript

I'm dealing with raw strings containing escape sequences for surrogate halves of UTF astral symbols. (I think I got that lingo right…) console.log("\uD83D\uDCA9") // => Let's use the above emoji as an example. If I have the surrogate pair…
3
votes
0 answers

Bizarre character in python string

I am reading the contents of a file and one of the characters is an unknown character. I copied the part of the file that had this unknown character to my text editor and created the following script. I uploaded an image of the script because I'm…
mnm
  • 39
  • 1
3
votes
2 answers

How to accommodate spaces in a variable in a bash shell script?

Hopefully this should be a simple one... Here is my test.sh file: #!/bin/bash patch_file="/home/my dir/vtk.patch" cmd="svn up \"$patch_file\"" $cmd Note the space in "my dir". When I execute it, $ ./test.sh Skipped '"/home/my' Skipped…
Bala
  • 3,938
  • 3
  • 19
  • 17
3
votes
1 answer

unescape diactrics in \u0 format (json) in ms sql (SQL Server)

I'm getting json file, which I load to Azure SQL databese. This json is direct output from API, so there is nothing I can do with it before loading to DB. In that file, all Polish diactircs are escaped to "C/C++/Java source code" (based on:…
3
votes
2 answers

How to decode a UTF16 string into a Unicode character

An device encodes a string "" as "\uD83E\uDD1B\uD83C\uDFFD". The hexadecimal numbers represented in this string are from the UTF-16 hex encoding of the character. The Unicode code point U+1F91B, U+1F3FD gets its numbers from the UTF-32 hex…
Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69
3
votes
2 answers

Python - Unicode & double backslashes

I scrapped a webpage with BeautifulSoup. I got great output except parts of the list look like this after getting the text: list = [u'that\\u2019s', u'it\\u2019ll', u'It\\u2019s', u'don\\u2019t', u'That\\u2019s', u'we\\u2019re', u'\\u2013'] My…
mgruber
  • 751
  • 1
  • 9
  • 26
3
votes
1 answer

Ruby string escape for supplementary plane Unicode characters

I know that I can escape a basic Unicode character in Ruby with the \uNNNN escape sequence. For example, for a smiling face U+263A (☺) I can use the string literal "\u2603". How do I escape Unicode characters greater than U+FFFF that fall outside…
Miles
  • 31,360
  • 7
  • 64
  • 74
3
votes
2 answers

Reading java file with escape characters for newline

I have a Unicode file that needs to be exported to database(Vertica). The column delimiter is CTRL+B, record delimiter is newline(\n). Whenever there is a newline within a column value, CTRL+A is used as escape character. When I use…
Santhosh
  • 1,771
  • 1
  • 15
  • 25