Thread: Native letters
-
November 16th, 2014, 13:44 #1
- Join Date
- Jun 2014
- Location
- Denmark
- Posts
- 8
Native letters
Hi
I think I have see the answer to this question some where in the forum, but I can't find it again.
I'm adjusting an extension to Danish, but when the skill names written in the Lua file is loaded it don't use the Danish letter.
The tekst in the lua scrip looks like this:
Skills =
{ ["Første hjælpe"] = { Base="INT", Category="Grundf�rdigheter", Grund="INT", Kost="1"},
In the attached picture you can see that the letters "ø" and "æ" looks very odd. It is only for the letters written directly in the lua script. It works fine the xml files due to the iso-8859-1 standard.
What to do I have to do to make lua read Danish letters?
-
November 17th, 2014, 22:26 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,562
FG uses a single byte string representation to translate text from Lua and database values into visible data on the screen. The font files (FGF) are a collection of 256 bitmaps rendered for each character in a single byte representation of that font. Depending on which font was used to render the FGF files, there can be differences in the actual glyphs/bitmaps displayed for those characters.
A couple thoughts:
* It could be the font missing certain glyphs for those characters. (i.e. not a true/full ISO-8859-1 output)
* It could be that the characters are being translated incorrectly somewhere along the way (Lua, FG API, ...)
I'm able to type those characters directly into 3.5E and 5E rulesets in the Skills sections, and see them correctly. So, I'm assuming it's a different ruleset with old font files.
Which ruleset are you modifying?
Regards,
JPG
-
November 19th, 2014, 20:35 #3
- Join Date
- Jun 2014
- Location
- Denmark
- Posts
- 8
Hi moon Wizard
It's the BRP ruleset, that I'm modifying.
A couple thoughts:
* It could be the font missing certain glyphs for those characters. (i.e. not a true/full ISO-8859-1 output)
* It could be that the characters are being translated incorrectly somewhere along the way (Lua, FG API, ...)
-
November 20th, 2014, 22:59 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,562
It has something to do with the existing encoding of the brpscript.lua file that you are modifying. Make sure that you set the encoding on the file you are creating that contains that string to ISO-8859-1.
I verified the existing issue by:
* Opening brpscript.lua file.
* Pasting in new skill line just below "First Aid" skill line.
* Saving file
* Open new campaign and create new character.
To fix,
* I opened the brpscript.lua file.
* Used my text editor (Notepad++) to specifically set the encoding to ISO-8859-1
* Noted that the previously pasted text was now mangled (exactly like messed up display before)
* Replaced the skill with the same text re-pasted from the forum.
* Saved file
* Opened character and found correct skill display.
Cheers,
JPG
-
November 23rd, 2014, 13:00 #5
- Join Date
- Jun 2014
- Location
- Denmark
- Posts
- 8
Thanks Moon, but how and where in the brpscript.lua file did you set the encoding?
Last edited by Claus; November 23rd, 2014 at 13:10.
-
November 23rd, 2014, 22:13 #6
Claus for XML its usually the first line in these files:
<?xml version="1.0" encoding="iso-8859-1"?>
Im not sure how you do it in LUA...
-
November 24th, 2014, 22:41 #7
- Join Date
- Jun 2014
- Location
- Denmark
- Posts
- 8
Ok - thanks
-
November 24th, 2014, 22:44 #8Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 24th, 2014, 23:45 #9
+Trenloe - I did see that in searching... so for the LUA you just need to save the file with the correct encoding?
You dont actually add any character sets / encoding tags / instructions.
-
November 25th, 2014, 21:27 #10
- Join Date
- Jun 2014
- Location
- Denmark
- Posts
- 8
Hi Trenloe
That worked! Thanks!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks