Use of special characters in blueprint yml files (Umlaute)

Hi all,
I am new to Kirby, started testing it.

Question: If I use german special characters (‘Umlaute’) in the bluepringt yml, even if written in double quotes, the panel throws always an error message ("The JSON response from the API could not be parsed. Please check your API connection. ").
If I replace the ‘Umlaut’ with a non-special character, it works well (e.g. “ä” replace by “ae”).

My yml file throws an error:

title: B
fields:
      proficiency:
           label: "Geschäftsbereich"
           type: text
           placeholder: "Geschäftsbereich, zB. Schmuck & Objekte"

This version does not throw an error:
> title: B
> fields:
> proficiency:
> label: “Geschaeftsbereich”
> type: text
> placeholder: “Geschaeftsbereich, zB. Schmuck & Objekte”

I am aware of UTF-8 recommendations concerning file storing. If this is the issue, how can I properly influence the file storing configuration on a Linux server? (I do not assume that I have to write a batch file to ‘iconv’ every yml-file, no?). What is a good practice?

Or is there another root cause for the error messages?

Thanks a lot for your help!

Good question I’ll check in my installation because this should be possible without problems.

Edit: Umlauts in labels in my dev environment work with & without quotes, same for the placeholder. Tested on a Mac using Valet. Also works under Ubuntu with PHP’s built-in server.

Is the mbstring extension installed and enabled? php -m in terminal shows installed modules.

What text editor are you using?

And is file encoding actually wrong? What do you get when you type file -i path-to-blueprint-file in terminal?

Have you checked your browser console for more information about the error?

Oh, and welcome to our forum, of course :slightly_smiling_face:!

1 Like

Thank you for your swift response, your advices and your kind words!

1/ The Server is Ubuntu Linux 20.04LTS and ‘mbstring’ is installed (libmbfl v1.3.2 etc.).

2/ $ file -i /path-to-blueprint-file returns text/plain; charset=us-ascii
So not UTF-8 :frowning: .

3/ Surprisingly, the comand $ locale returns
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE=“de_DE.UTF-8”

Command $ locale -a does not even list en_US.ascii , but only en_US.utf8 (among several others) .

4/ My session client (ftp…) is MobaXTerm. I make changes in its integrated text editor. Its terminal supports UTF-8 (unicode) (I checked this in the config).

5/ I checked the blueprint-file in the linux terminal using the pre-installed nano editor . Nano displays the typical special characters misinterpretation of german Umlaute '. So the Umlaute are stored in the file, but Kirby does not digest them when parsing.

6/ I have to admit that I am a little bit lost now. What I should do? Ubuntu supports UTF-8, the session client supports UTF-8, however the file -i says it’s us-ascii . The special character is stored (according to nano), but Kirby cannot read it properly. Pooh. (Currently I am trying to get through this infos: https://iconoun.com/articles/collisions/ . I am trying to check it there are malformed UTF-8 characters, which crash JSON parsing.)

This is probably a config problem exceeding Kirby support scope, but if you could give me a hint, where I could touch something to get closer to a solution, it would be great!

Thanks a lot in advance,
Best regards

Maybe use an editor like VS Code or an IDE and create your files locally (more comfortable anyway and you get proper syntax support), then send to the server using FTP. I’m only starting out on Linux and can’t really help with getting your integrated text editor to work properly.

1 Like

This should not happen. Even nano can display Umlaute if the encoding is correct. And if your file contains Umlaute and file -i says it is us-ascii, there is something wrong with encoding of the file. file -i gives you us-ascii if there are no special characters within the file. If there is only one Umlaut, it should report utf-8 (in most cases).

1 Like

Try to save the file locally with a good editor like notepad++ under windows in utf8 format. Then use filezilla to ftp it to the server.
This my way makes all ok.

Try to change the locale settings of the server AND within Kirby to “de_DE.utf8” without “-”.

1 Like

Hi texnixe, HeinerEF, pixelijn and Adspectus,

thanks for your advices, very good!

1/ Indeed using notepad++ with coding set to UTF-8 solved the problem.
Kirby JSON import works now and Linux confirms file charset=utf-8 .

2/ So, it’s probably a bug in the mobaXTerm internal editor. It’s Config confirms that encoding is UTF-8, however demonstrably text files are written as us-ascii .

3/ I replace the mobaXTerm internal editor permanently with notepad++.

I am sorry for having bothered you with my internal config misalignments and very happy that you helped me nevertheless. You are a great community!

Thx for your help, all the Best,
Ekke

My recommendation is that you set up a development environment locally instead of editing files and sending them to the server for testing.

You can find a few options here: https://getkirby.com/docs/cookbook/setup/development-environment

Also, if you want to use PHP debugging and more, Notepad++ might not be the optimal choice of tool (can’t say for sure, because not a Windows user and thus not familiar with the tool).

Thank you for your recommendations!

1/ I am using IDE WebStorm respectively PhpStorm provided by Jetbrains.
PhpStorm supports yaml quite well, I’ll configure an Kirby CMS dev environment asap and test it. If the integration works, I will omit the session client (incl. np++).

2/ Laravel/Vagrant + VirtualBox sounds good, for sure, and can be combined with PhpStorm as well.
Are there comunity or external experiences in configuring and using PhpStorm + Laravel/Vagrant for dev with Kirby CMS?
(honestly I have not yet checked the forum regarding this, but will do asap.)

3/ Additional question: Are there IDE Code Highlighting or auto-completion support / plugins for Kirby-CMS-specific reserved keywords and functions (e.g. fieldnames (image, videos, …), Query Language (blueprints) , Kirby’s PHP API)?

Thanks a lot!

Yes, great tool, using it as well recently.

Can’t answer the second question, been using Laraval valet on Mac, now for the moment the built-in PHP server on Linux until I will have made up my mind :wink:

1 Like