0

starting or trailing white space in zk-label.properties

asked 2020-11-20 10:29:36 +0800

54patman gravatar image 54patman
13 3

updated 2020-11-20 10:31:10 +0800

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

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-23 10:05:51 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2020-11-23 10:06:30 +0800

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). image description

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.

image description

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-11-20 10:29:36 +0800

Seen: 9 times

Last updated: Nov 23 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More