UTF-8 in yaml

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

sluhtie

Supporter
Feb 8, 2020
116
9
18
Germany
cwcodes.de
Hello everyone, I want to crate a external config using Skript where you can set the prefix of my Skript. But everytime I open the generated config there are these funny color codes:

Code:
prefix: "\xa78[\xa7eAntiBuild\xa78]"

But I want to have the Color codes like &a and &4... If you know what I mean.

Well the value works good but If I Change the prefix in the extrenal config from "\xa78[\xa7eAntiBuild\xa78]" to "&8 ● &eMagma&6Vace &8»" I become this message in chat:

YHYLPRW.png


Firstly the Color codes don't work and the UTF-8 dosen't work so how can I Import Color codes and UTF-8 format in external configs?

Here is my Skript:

code_language.skript:
on load:
    file existance of "plugins/AntiBuild/config.yml" is false:
        create file "plugins/AntiBuild/config.yml"
        set "prefix" to "&8[&dPrefix&8]" in yaml file "plugins/AntiBuild/config.yml"


command /test:
    trigger:
        set {prefix} to single value "prefix" get of "plugins/AntiBuild/config.yml"
        broadcast "%{prefix}%"

Here is the generated config.yml:

Code:
prefix: "\xa78[\xa7eAntiBuild\xa78]"

Skript Addons:
WildSkript (Ver: 1.8)
Skellett (Ver: 1.9.6b)
skRayFall (Ver: 1.9.19)
SkQuery (3.21.4)

Skript Version: 2.1.2
Server Version: Spigot 1.8.8
Client Version: Vanilla 1.8.9

Thanks for every answer!
 
Last edited:
Hello everyone, I want to crate a external config using Skript where you can set the prefix of my Skript. But everytime I open the generated config there are these funny color codes:

Code:
prefix: "\xa78[\xa7eAntiBuild\xa78]"

But I want to have the Color codes like &a and &4... If you know what I mean.

Well the value works good but If I Change the prefix in the extrenal config from "\xa78[\xa7eAntiBuild\xa78]" to "&8 ● &eMagma&6Vace &8»" I become this message in chat:

YHYLPRW.png


Firstly the Color codes don't work and the UTF-8 dosen't work so how can I Import Color codes and UTF-8 format in external configs?

Here is my Skript:

code_language.skript:
on load:
    file existance of "plugins/AntiBuild/config.yml" is false:
        create file "plugins/AntiBuild/config.yml"
        set "prefix" to "&8[&dPrefix&8]" in yaml file "plugins/AntiBuild/config.yml"


command /test:
    trigger:
        set {prefix} to single value "prefix" get of "plugins/AntiBuild/config.yml"
        broadcast "%{prefix}%"

Here is the generated config.yml:

Code:
prefix: "\xa78[\xa7eAntiBuild\xa78]"

Skript Addons:
WildSkript (Ver: 1.8)
Skellett (Ver: 1.9.6b)
skRayFall (Ver: 1.9.19)
SkQuery (3.21.4)

Skript Version: 2.1.2
Server Version: Spigot 1.8.8
Client Version: Vanilla 1.8.9

Thanks for every answer!


Make shure the charset of both the .yml and the .sk are set.

77a309909efdb16c77f638e64c2f45fe.png

df80f883e3de415e567c248da66fce8b.png
 
You must do like this

code_language.skript:
on load:
    file existance of "plugins/AntiBuild/config.yml" is false:
        create file "plugins/AntiBuild/config.yml"
        set {_pf} to "
        set {_pf} to "&8[&dPrefix&8]"
        set yaml value "prefix" to "%uncolored {_pf}%" in yaml file "plugins/AntiBuild/config.yml"


command /test:
    trigger:
        set {prefix} to single value "prefix" get of "plugins/AntiBuild/config.yml"
        broadcast "%colored {prefix}%"
 
Status
Not open for further replies.