Questions tagged [character-encoding]

Questions about character encoding and decoding. This includes, but is not restricted to, conversion of characters to their numerical value in a character table and vice versa and conversion of characters to strings and vice versa.

1
vote
0answers
62 views

What are the special characters `\!`, `\@`, etc.?

Character codes 63425 through 63436 (within the WL private use range) can be typed with backslash escape sequences. Despite displaying like digraphs they are single characters: ...
1
vote
0answers
47 views

How can I handle box drawing characters?

I must generate files for windows batch scripting, modifying template files, es. ...
3
votes
1answer
48 views

One-hot vectors encoding with NetEncoder

I have a text and vocabulary (text has two "the" entries): ...
1
vote
0answers
14 views

Is there an inverse type function to SequenceLastLayer[]?

I am working on a text based autoencoder, and was happy to see I can feed a variable length text sequence into my network and use SequenceLastLayer[] after a GatedRecurrentLayer[] to only get the ...
4
votes
1answer
80 views

AlphabeticSort of Chinese character is not working now

I want to sort strings of chinese characters. I used to use below code list={"大家","早上","好"}; AlphabeticSort[list, Entity["Language", "ChineseMandarin"]] And it ...
0
votes
0answers
41 views

How to ImportString “JSON” with Unicode characters? [duplicate]

Update The short answer is that when getting results back from an API into an HTTPResponse object the "Body" property is a post-...
2
votes
2answers
242 views

How do I add EOF character to a CSV file?

I am using Mathematica to create a CSV file to be used by another program (SRIM if needed). The file must end with the EOF character. I get an error from SRIM telling me that the file does not have ...
3
votes
3answers
106 views

Convert Latin to e.g Gothic

Sorry for the very simple question but I can't seem to find an answer anywhere. I have a list of Latin letters, e.g. {a, b, c, d...}. I want to convert them to the corresponding Gothic letters. How ...
5
votes
2answers
156 views

Convert Unicode to Math Input

Any Ideas how I could convert unicode to Mathematica Input ? For instance : I have the following Unicode: test= {"a", "\\:1d62"} So here I would like to convert ...
2
votes
0answers
57 views

How to render an emoji? [duplicate]

Is there any way to get Mathematica to render emoji's from unicode strings? For instance, ":1F600" should be 😀but it renders as an "oulinded question mark": Also, ...
5
votes
1answer
38 views

Exporting/Saving Notebook with Non English characters to PDF

On a related question, I now have another problem with saving notebook to PDF. OS: Windows 7 SP1 English Ultimate MMA: 11.3 X64 The Chinese characters displays ...
8
votes
1answer
120 views

Fail to load a UTF8 package with one special Chinese character

Please check out the following code. BeginPackage["WTF`"] f::usage="blah" Begin["`Private`"] f[x_]:=1(*盘*); End[] EndPackage[] I've save the code to ...
2
votes
0answers
38 views

How to make the notebook show properly some special characters?

Those special characters, e.g., are , , and . They ...
6
votes
0answers
127 views

Passing UTF-8 to wolframscript on the command line

I am trying to use Unicode input to wolframscript -c, like so: $ ./wolframscript -c '1/∞' â^(-1) The source of this behavior ...
17
votes
1answer
400 views

HMAC correct on 11.2 but wrong and different on 11.3 running same code

If you run this code on 11.2 ...
6
votes
1answer
112 views

Encoding strings to workaround CloudDeployment bugs

Bug introduced with FormFunction and persisting through Cloud V1.48 CASE:4026150 confirmed There are few problems when deploying simple ...
3
votes
2answers
176 views

Import text outlines from PDF format properly

Bug introduced in 10.0 and persisting through 11.3 I am attempting to implement this: How can I wrap text around a circle? But I need Unicode support. Unfortunately, in my case, this gives a broken ...
0
votes
0answers
37 views

Chinese characters encoding into numbers and back again to characters problem

I have a bunch of Chinese characters that I would like to change into decimal numbers, then into binary numbers. I would then like to take back the binary numbers and change them into decimal numbers ...
3
votes
2answers
83 views

Explicitly control newline behaviour when writing strings with arbitary encoding

On Windows system, Mathematica by default opens stream which will automatically transform any "\n" into "\r\n". But I want pure ...
1
vote
0answers
43 views

How to print greek letters in wrapped text

Here some code for creating wrapped text ...
1
vote
1answer
253 views

How to type these Unicode characters or make my own character?

How can I type the following characters without copying and pasting them from the web? Perhaps define them as a character myself? Also, they are not displayed properly when pasted in a code cell but ...
4
votes
2answers
130 views

J/Link HMAC Base64

I am trying to recreate a Java algorithm in Mathematica. It is taking a key and signing a message using the HMAC and SHA256 algorithm. The Java code for which I am basing it off is here I have ...
2
votes
0answers
242 views

How to decode Ascii85 format (AKA base85)?

The ASCII85 encoding is a binary string encoding where every four bytes are encoded with five ASCII letters, using 85 different types of characters. Unfortunately, it's not in $CharacterEncodings: ...
0
votes
0answers
237 views

Problems with UTF8 CSV Import in Mathematica 11.2

I have a lot of code for importing csv data from a research project. Everything fine with Mathematica 11.1.1. Now I have 11.2 and it seems as if UTF8 import ist buggy. I use the following simple code ...
6
votes
1answer
3k views

Base64 Encoding and Decoding not correct?

When comparing the output of decoding a base64 encoded string, the Mathematica output and the output of https://www.base64decode.org does not match. ...
0
votes
2answers
117 views

How to get a right character when we use cmd command

This is my runtime environment $Version $CharacterEncoding "11.1.1 for Microsoft Windows (64-bit) (May 16, 2017)" "CP936" When I run ...
4
votes
1answer
115 views

URLRead ignores content-encoding:gzip header

Background Taking an example from Decoding GZIP encoded Body, BodyBytes (ByteArray) and BodyBytesArray from URLRead: ...
5
votes
1answer
223 views

A bug in converting some Unicode characters into FullForm?

Currently I know only one well-documented way to convert all special characters in an arbitrary string into their FullForm: In ...
23
votes
3answers
3k views

Who is to blame: parsing UTF8 encoded JSON HTTPResponse fails

Bug introduced in 11.0 or earlier and persists through 11.3 (confirmed by WRI Support but read summary below) Answers summary I think we need a quick summary here to justify keeping bug. Original ...
3
votes
1answer
123 views

Convert characters to binary?

I can get a binary representation of characters as follows: BaseForm[ToCharacterCode["A"], 2] However, that produces a weird binary code object that might be ...
5
votes
0answers
45 views

Swedish characters in Databin

I want to store strings with Swedish characters like å, ä and ö in a Databin, but get the following result: ...
6
votes
0answers
238 views

How to create a prefix code

I am trying to create a demonstration of shannon code in mathematica. Given a list of lengths (l1, l2,..lk) I need to create a list of binary lists (or list of ...
4
votes
3answers
188 views

Find prefix of list in Association

I am new with Mathematica, so I am sorry if my question is a little bit trivial. I am trying to write some kind of demonstration for coding algorithm (for prefix codes). I have an Association that ...
9
votes
1answer
622 views

How to export strings as pure ASCII?

The "PrintableASCII" characters set consists of 97 characters, including space (\[RawSpace]) and two control characters: the ...
5
votes
2answers
121 views

Possible bug in Export with CharacterEncoding -> “PrintableASCII”

In the Documentation we read (emphasis is mine): By default, the Wolfram System uses the character encoding "PrintableASCII" when saving notebooks and packages. ...
5
votes
1answer
177 views

Decoding GZIP encoded Body, BodyBytes (ByteArray) and BodyBytesArray from URLRead

When calling the Stack Exchange API v2.2 using the new (Mma11) function URLRead we get a GZIP encoded Body in alternative formats: ...
8
votes
3answers
187 views

Re-encode text file to use Mathematica's character name, like \[Alpha]

How can I re-encode a text file (or string) so that non-ASCII characters will be represented using Mathematica's standard names? For example, if the original contents of the file was ...
14
votes
2answers
472 views

How to workaround failures with Unicode filepaths?

(Cross-posted on the Wolfram Community.) The Mathematica's Kernel and FrontEnd currently work well with Unicode file/directory paths, but some other components of the system contain long-standing ...
1
vote
1answer
92 views

Encode accents for html

I'd like to create an HTML file from a String, such as "abcdéèçàdefghijk". I tried different methods with no success. For ...
1
vote
1answer
2k views

How to deal with Chinese Windows path/filename? [duplicate]

I've encountered a problem with Unicode Windows file name. If I set the file name to Unicode characters on Mac OSX, it works well. But on Windows if the filename starts with a digital number or the ...
4
votes
1answer
73 views

Inverse of CharacterName [duplicate]

Is there an inverse function to CharacterName? For example, CharacterName["ε"] gives ...
5
votes
1answer
232 views

What's purpose of function System`Private`LookupCodeByName and System`Private`LookupNameByCode [closed]

These are useful function from their name.And they are kernel function since: ...
0
votes
0answers
58 views

How to interpreter file into date and json?

I have DateAndJson.txt and want to analyse it. ...
3
votes
0answers
151 views

Displaying Mathematica expressions in plain text

I'm trying to export expressions in plain text format, so they can be displayed in a reasonably orderly way (.txt file). Trying: ToString[a^c/b] yields ...
1
vote
1answer
77 views

Copy as Input Text via Function

I've got some code which generates a series with coefficients that are a rather complicated expressions of Greek letters with subscripts. I want to store some of these coefficients for future use, ...
5
votes
0answers
61 views

How to transform traditional Chinese string into simplified Chinese string in Mathematica?

There are two type of written Characters in Chinese: traditional Chinese and simplified Chinese. Is there a way to transform traditional Chinese string into simplified Chinese string in Mathematica? ...
8
votes
0answers
169 views

How to correctly CloudDeploy code which contains non-English characters?

As an illustration: CloudDeploy[{"中文"}] will give a url. After open it, I got following on the web page {\:4e2d\:6587} ...
0
votes
1answer
251 views

How to replace the value that include infinity?

Good day, I have the output A and I want to do some operation to A: A = {0, 1, 2} B = -Total[(#*Log2[#]& /@ A] when i run, has error : ...
0
votes
1answer
75 views

How to extract the certain variable from output of coding

Good day, Can anyone help me how can I extract the certain value from the output after run the coding. ...
2
votes
2answers
501 views

How to translate/convert UTF-16 code to its corresponding word/characters by Mathematica?

I'm using Mathematica10.0.2 on my Win7. Recently I crawled some websites by mathematica and within the information returned by URLFetch there are plenty of UTF-16M codes. These UTF-16M codes are ...