Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
- Mr_Custom
-
100+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
The project https://scratch.mit.edu/projects/312865258 contains unicode ‘special’ fonts that are fine in the background and font selection lists but then break when you convert most of them?! Only a few characters (y is one of them) always work! The rest are just replaced with a question mark in a diamond!
Last edited by Mr_Custom (May 25, 2019 10:19:15)
- 098765432154321
-
500+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
Scratch doesn't support some unicode characters.
I tried to use Emojis in my Instructions section, but they were all replaced with 2 question marks, which probably means they are part of unicode and not supported
I tried to use Emojis in my Instructions section, but they were all replaced with 2 question marks, which probably means they are part of unicode and not supported
Last edited by 098765432154321 (May 25, 2019 12:36:57)
- imfh
-
1000+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
My guess is that letter ( ) of [ ] doesn't support unicode very well. You'll probably have to make your lists hold 1 character per item rather than 1 font per item. You can do that with something like this:
Last edited by imfh (May 25, 2019 16:31:26)
- Mr_Custom
-
100+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
Thanks, will try that now!
- Mr_Custom
-
100+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
My guess is that letter ( ) of [ ] doesn't support unicode very well. You'll probably have to make your lists hold 1 character per item rather than 1 font per item. You can do that with something like this:
Thanks for the help, but now of course my problem is getting all the characters in to a list without the
block!
Any ideas that might help me with this, because it is over 1000 items to do manually!
- imfh
-
1000+ posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
I would export first export the list. That will turn it into a text document which should be easier to edit. Each item goes onto a new line. You could use something like Python to do this for you:
(I haven't tested the above so it might not work. I'll probably come back later to add comments and double check it)
csv1 = open("font tree old.txt", "r", encoding="utf8") # Open the old font tree result = "" # This will hold the new tree for line in csv: # Loop through each font for character in line: # Loop through each character of font result = result + character + "\n" # Turn the character into its own item csv1.close() # Close the old font tree file csv2 = open("font tree new.txt", "w", encoding="utf8") # Create the old font tree file csv2.write(result) # Save the results csv2.close() # Close the file
Last edited by imfh (May 27, 2019 12:39:21)
- ssilspro
-
11 posts
UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!
use google translate
for exampl 6 upper:
______
utf16: (45)
8474 | 55349 56654 | 55349 56636 | 8477 | 55349 56651 | 55349 56656 | 55349 56652 | 55349 56640 | 55349 56646 | 8473 | 55349 56632 | 55349 56650 | 55349 56635 | 55349 56637 | 55349 56638 | 8461 | 55349 56641 | 55349 56642 | 55349 56643 | 8484 | 55349 56655 | 8450 | 55349 56653 | 55349 56633 | 8469 | 55349 56644
_______
unicode code point: (26)
8474 120142 120124 8477 120139 120144 120140 120128 120134 8473 120120 120138 120123 120125 120126 8461 120129 120130 120131 8484 120143 8450 120141 120121 8469 120132
_______
the 2nd letter is two letters, utf16code:55349 56654, unicode code point:120142
so it's not 26 letters, it is 45 in scratch, and if export to file, it is saved as utf8(no decode surrogate pair in 2.0)
if length of font letters is 26, 1 font letter as 1 input letter,
if 52, 2 as 1 ,
if other, 1 or 2 as 1
you can split it with other letter or space or … in order to search, or
fill all to 2 letters, delete fill letter after covert
for exampl 6 upper:
______
utf16: (45)
8474 | 55349 56654 | 55349 56636 | 8477 | 55349 56651 | 55349 56656 | 55349 56652 | 55349 56640 | 55349 56646 | 8473 | 55349 56632 | 55349 56650 | 55349 56635 | 55349 56637 | 55349 56638 | 8461 | 55349 56641 | 55349 56642 | 55349 56643 | 8484 | 55349 56655 | 8450 | 55349 56653 | 55349 56633 | 8469 | 55349 56644
_______
unicode code point: (26)
8474 120142 120124 8477 120139 120144 120140 120128 120134 8473 120120 120138 120123 120125 120126 8461 120129 120130 120131 8484 120143 8450 120141 120121 8469 120132
_______
the 2nd letter is two letters, utf16code:55349 56654, unicode code point:120142
so it's not 26 letters, it is 45 in scratch, and if export to file, it is saved as utf8(no decode surrogate pair in 2.0)
if length of font letters is 26, 1 font letter as 1 input letter,
if 52, 2 as 1 ,
if other, 1 or 2 as 1
you can split it with other letter or space or … in order to search, or
fill all to 2 letters, delete fill letter after covert
Last edited by ssilspro (June 1, 2019 17:59:35)
- Discussion Forums
- » Help with Scripts
-
» UNICODE SPECIAL TEXT ONLY SOMETIMES DISPLAYED!