3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos
aszlig cb796ccd09
nixos/test-driver/Logger: Replace invalid UTF-8
Regression introduced by d84741a4bf.

The mentioned commit actually is a good thing, because we now get the
output from the X session.

Unfortunately, for the i3wm test, the i3-config-wizard prints out the
raw keyboard symbols directly coming from xcb, so the output isn't
necessarily proper UTF-8.

As the XML::Writer already expects valid UTF-8 input, we assume that
everything that comes into sanitise() will be UTF-8 from the start. So
we just decode() it using FB_DEFAULT as the check argument so that
every invalid character is replaced by the unicode replacement
character:

https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character

We simply re-oncode it again afterwards and return it, so we should
always get out valid UTF-8 in the log XML.

For more information about FB_DEFAULT and FB_CROAK, have a look at:

http://search.cpan.org/~dankogai/Encode-2.84/Encode.pm#Handling_Malformed_Data

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-26 14:24:33 +02:00
..
doc/manual nixos-generate-config: Emit LUKS configuration for boot device 2016-05-25 18:04:41 +02:00
lib nixos/test-driver/Logger: Replace invalid UTF-8 2016-05-26 14:24:33 +02:00
maintainers ec2/create-amis.sh: specify the approriate size on snapshots 2016-05-07 19:44:39 +01:00
modules xsession: fix variable read before set introduced in c99608c 2016-05-25 17:47:36 +01:00
tests nixos/tests/installer.nix: nixos-generate-config detects LUKS since a7baec7 2016-05-26 04:02:36 +01:00
COPYING
default.nix nix: Add a "dev" output 2016-04-18 21:13:18 +02:00
README
release-combined.nix Make i3wm test a release blocker 2016-05-26 10:47:15 +01:00
release-small.nix containers: test imperative and ipv4 in small-release (#15015) 2016-04-26 22:38:47 +02:00
release.nix nixos/tests: Add a test for boot stage 1 2016-05-06 16:56:43 +02:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.