Three likely culprit:
- The file is compressed but your machine can't detect it. So for example the 3MF model has been zipped, and what you are trying to do is opening the zip archive in the text editor, rather than the file that is in the zip archive. Solution: try to see if common decompress utilities like zip, gzip, 7z can open the file.
- The file is a 3MF model but the character encoding in the file being different than the one your editor is expecting (typically
Unicode/UTF-8, these days). Solution: read on the rest of this answer.
- The file is a binary one that is totally unrelated to 3MF. So in essence: an error, you are trying to open maybe an MP3 or a JPG file believing it to be a 3MF instead.
As for the "wrong encoding" option... Oversimplifying a bit, the story goes like this:
- computers write data to files in bytes,
- a byte can only be set to one of its 256 possible values,
- in the early days of computing, when computers were just glorified calculators, it was enough to have a 1:1 ratio between the byte possible values and the symbols one wanted to use, so ASCII was born (actually ASCII only "mapped" the first 127 values of the byte, but that is a detail). So: value #49 would represent a
1, value #90 a
Z and so on...
- shortly afterwards, computers became powerful enough that people wanted to use them to process human languages, so the need for more characters (like accented ones
åáä or the ones from non-latin alphabets like Cyrillic
язы́к or arabic
عَرَبِيّ, or...) came to be and engineers speaking different languages had the "brilliant" idea to each use the other 127 "free slots" in a byte for their favourite languages, thus a plethora of extended ASCII encodings was born, each using the same byte value, but each mapping to a different symbol.
- later on, people began to realise the need to combine the use of say Gaelic, English, Japanese and Farsi with mathematical symbols, and thus they came up to way to map symbols to values expressed as the product of more bytes (so for example: 2 bytes encoding could map 256x256=65536 symbols). Again: each system using the same values but different symbols.
- finally after decades of frustrated users and expensive bugs, engineers around the world settled for a multi-byte standard that has 1,114,112 possible values that could contain all characters one can possibly need, and Unicode was born.
Back to your question: despite unicode having been around for a few decades now, legacy software and sloppy programming are a thing, and there are still systems that do not use unicode internally but some legacy "special purpose" encoding.
Unfortunately, it is impossible to say with certainty how a file was encoded, so occasionally you may find yourself opening a file and starting decoding it according to a "conversion table" that is not the one used by the author of the file itself. This is what it looks like is happening to you.
Onward to what you can try to do to fix this...
First of all: as attentive readers may have already inferred, you will need the actual file for this. In fact if you cut-and-paste its "content" from an editor what you are really doing is cutting-and-pasting the decoding your computer did of the byte values, and not the byte values themselves.
Then your best bets are:
- Try one of the online detectors like this one, using "English" as a language. These detectors work by trying all the decoders they know of until the decoded file will have English (or another language of your choice) words in it. This may not work for you as a 3MF file is mostly numbers, not text, but it is worth a shot.
- Guesstimate what encoder may have been used. For example: if you got the file from an old windowsXP machine from Eastern Europe, chances are it may have been encoded with "windows-1251". Use an online converter to see if you were right about it.
- Use brute force. For this you will require to write a simple programme or ask somebody to do it for you, but the key idea here is to have a script taking your original file and decoding it using all encoders in that programming language knows of. Then it will be up to you to open each decoded file individually and verify if it worked or not.