PDA

View Full Version : Does FGU support an Unicode?



SomeFire
March 25th, 2020, 13:44
Or translation still the hard work like in FGC? Copy-paste works wrong with current FGC encoding. You know, in 2020 it is a bit silly to write symbols like
&#199 ; &#237 ; &#224 ; &#237 ; &#232 ; &#229 ; Unreadable and uneditable.

Moon Wizard
March 25th, 2020, 19:41
Where are you entering those characters?

If they are entered in XML, then the character codes will map to the version of the character specified by the encoding at the top of the XML file. (In FGC XML export files, that is ISO-8859-1.)
If they are entered in the UI, I believe you should just be able to enter from your keyboard, or copy and paste.

The underlying text storage encoding in FGU is UTF-8; so it should save correctly. One caveat is that our font system currently only supports Latin1, Supplemental, Extended A and Extended B characters.

Regards,
JPG

Mortar
March 25th, 2020, 19:51
Or translation still the hard work like in FGC? Copy-paste works wrong with current FGC encoding. You know, in 2020 it is a bit silly to write symbols like
Ç ; í ; à ; í ; è ; å ; Unreadable and uneditable.

FGU will probably read those fine as plain text either via the XML or via the UI.

Mortar
March 25th, 2020, 20:12
Just ran a quick test...

32554
32555

Entered into the FGU UI as plain text (straight copy/paste from the quoted message in my last reply. FGU exported them into a module as plain text.

Trenloe
March 25th, 2020, 20:23
FGU exported them into a module as plain text.
I don't think that's "plain" text - check the Encoding that Notepad++ is auto detecting and displaying, probably it'll say "Encode in UTF-8".

Mortar
March 25th, 2020, 20:25
Its UTF-8, but in the XML itself the characters are displayed as text without being encoded.

Trenloe
March 25th, 2020, 20:30
Its UTF-8, but in the XML itself the characters are displayed as text without being encoded.
I'm not sure you're using the right terminology here - which is confusing us trying to be on the same page.

As Moon Wizard said above "If they are entered in the UI, I believe you should just be able to enter from your keyboard, or copy and paste." Which is what you are seeing - you are copying/pasting direct into the UI and FG just stores that as UTF-8 in the XML. This is not "plain text" - this is UTF-8 encoded text.

Moon Wizard also says "If they are entered in XML, then the character codes will map to the version of the character specified by the encoding at the top of the XML file. (In FGC XML export files, that is ISO-8859-1.)"

So, are you saying things aren't working as Moon Wizard describes or they are working as described?

SomeFire
March 25th, 2020, 22:20
Looks like forum have the same issue. Look at the screenshot: 32560

When I manually enter text to a story inside the FGC I see normal text (thx to custom fonts). But when I open story in the notepad++ I see special numbers (top codeblock on the screenshot) instead of readable text.

When I copy-paste text from pdf to a story inside the FGC I see invalid characters (bottom codeblock on the screenshot) or '?' instead of any character. Same happens if I write text in XML file - in FGC I see invalid characters.

LordEntrails
March 25th, 2020, 22:44
When I copy-paste text from pdf to a story inside the FGC I see invalid characters (bottom codeblock on the screenshot) or '?' instead of any character. Same happens if I write text in XML file - in FGC I see invalid characters.
This is often do to the fonts use non-standard characters. They are called 'ligatures' and are often used to changed the spacing between characters. Such as the characters 'fl' have the two characters replaced with one character. Since those are not standard characters that come out of the PDF, their is little FG can do about it. Google the term for more details.

LordEntrails
March 25th, 2020, 22:46
There is actually a detailed response from MoonWizard to a very similar discussion. See; https://www.fantasygrounds.com/forums/showthread.php?54871-Font-Character-issues-in-FGU&p=485371&viewfull=1#post485371