cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

How are Mathcad strings encoded?

StuartBruff
23-Emerald IV

How are Mathcad strings encoded?

Does anybody know how Mathcad strings are encoded?

 

I've got a project on the back burner to look at Babylonian mathematics, including astronomical observations.  I'd like to convert between Arabic and Sumerian/Babylonian numbers and display them accordingly.  Unfortunately, whilst Unicode has code points for cuneiform numerals, I can't display them.

 

According to the Mathcad Prime 11 Help,

 

  • vec2str(v)—Converts a vector of UNICODE codes in v to a string. This function also works with zero-length strings, such as vec2str(0) = "".
  • str2vec("S")—Converts a string S to a vector of UNICODE codes corresponding to the characters in S. This function also works with zero-length strings, such as str2vec("") = 0
  • v is a vector of integers representing UNICODE code points for any valid string character. Acceptable values are integers in the range 9, 10, 13, or 32 - 255.
  • The mapping of codes to characters is done by your system codepage, and depends on the language of your operating system. It is possible for the same document to produce different strings/codes depending on the currently installed codepage of the system on which it is run.

 

The restriction to valid integers being < 256 isn't strictly true.  Mathcad string vectors can contain many code points from the Basic Multilingual Plane (BMP) (ie, values < 65536 U+FFFF),  Mathcad strings do not, however, support code points in the Supplementary Planes (eg, the Supplementary Multilingual Plane U+10000 - U+1FFFF).

 

There is, however, a mechanism called Surrogate Pairs that provides an alternative to indexing a character in a Supplementary Plane. 

 

I'm not sure whether Mathcad doesn't support surrogate pairs, or whether I'm not using them correctly.

 

2025 10 28 A.png

 

The ability to use supplementary characters might be useful to players of games, as there are code points for playing cards, dominos, chess pieces, and mahjong.

 

Stuart

 

https://en.wikipedia.org/wiki/List_of_Unicode_characters#Game_symbols

0 REPLIES 0
Announcements

Top Tags