-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm almost embarrassed to ask this question but how do I get extra white spaces in the language (Labels) properties file, starting and trailing.
In zk-label.properties I basically have
my.key= value
which I want 2 spaces before and after
my.key=<SPACE><SPACE>value<SPACE><SPACE>
when loaded it trims the spaces and all I get is the value.
I have tried:
\u0020
\\u0020
<br>
& n b s p ; (none breaking space)
\ \
Nothing, the loader simply loads the string as is.
Looking at the code Maps.load(Map, InputStream, String, boolean) it simply calls Strings.skipWhitespaces() or Strings.skipWhitespacesBackward() but never tries to resolve the unicode or anthing.
What am I missing?
Thanks in advance
You're not missing anything. ZK's '.properties'-files are UTF-8 by default so that every possible character can be added directly. As you noticed escape characters are not implemented by the code.
Instead you have to enter the non breaking space literally (make sure you edit/save the file a UTF-8).
Here an example of what is looks like in intellij (results may vary between IDEs).
E.g. On linux I had to type the non breaking space in a separate text editor CTRL+SHIFT+U
then type 00A0
) because the shortcut was already occupied by the IDE. In any case once the NBSP is in the text the intellij highlights is accordingly and ZK will output it unchanged.
Asked: 2020-11-20 10:29:36 +0800
Seen: 9 times
Last updated: Nov 23 '20