Enter NULL characters in vi...
Steve Flynn
anothermindbomb at gmail.com
Wed Mar 3 21:48:02 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/03/10 21:40, Marius Gedminas wrote:
> On Wed, Mar 03, 2010 at 09:35:25PM +0000, Steve Flynn wrote:
>> Been working on some code to clean up UTF16 encoded files and I find
>> myself needing to create a test file with some NULLs embedded within it.
>>
>> I had hoped that (in vi) Ctrl-V followed by an @ would do the trick but
>> it seems not.
>
> This works for me:
>
> start vim nulls.txt
> press i to enter insert mode
> type "null: ["
> press ctrl-v
> press ctrl-@
> type "]"
> hit esc
> type ":wq"
> press enter
> run xxd nulls.txt to verify:
>
> 0000000: 6e75 6c6c 3a20 5b00 5d0a null: [.].
>
> The character between [ and ] has code 0x00, as requested.
Works for me too... now. God knows what I was doing differently before!
Sorted now thanks.
- --
Steve Flynn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkuO2RIACgkQpOzvLkUb86DDCgCfYbnRgcyzMw8ORU5mLlOEdqwb
OIAAnRLfwpm1JRVpdXepSuKcrmLA24Rb
=FoCa
-----END PGP SIGNATURE-----
More information about the ubuntu-users
mailing list