Question: I’m using Rails 3.0.7 and ruby 1.9.2 with cucumber and capybara. I just had this problem, and I can’t find a solution :(

> 
> invalid byte sequence in US-ASCII (ArgumentError)
>  :10:in `synchronize'
>  (eval):2:in`click\_button'
>  ./features/step\_definitions/vouchers\_company\_steps.rb:25:in `/^I use it in my voucher UI$/'
> 
> 
> 

I think it has something to do with the form submission which is a GET and the famous utf8 tick. I don’t have this problem with my other forms. This one is using metasearch, I don’t know if it can help.

Answer: 
You've pretty much answered your own question: given a four-byte `int` and an 8-byte `double`, `v` would use 8 bytes of memory.

If unsure, you could compile and run a simple program that'll print out `sizeof(v)`.
Given that `int` is 4 bytes and `double` is 8 bytes (which is *not* guaranteed by the language), `sizeof (Values)` is *at least* 8 bytes.

Most commonly it will be exactly 8 bytes (more generally, `sizeof (int)` or `sizeof (double)`, whichever is larger), but compilers are permitted to add unnamed padding to structs and unions. For structs, any such padding can be between any two mebers, or after the last one; for unions, it can only be at the end.

The purpose of such padding is to allow for better alignment. For example, given:

```
union u {
    char c[5];
    int i;
};

```

if `int` is 4 bytes and requires 4-byte alignment, the compiler will have to add padding to make `sizeof (union u)` at least 8 bytes.

In your particular case, there's probably no reason to add any padding, but you shouldn't assume that there isn't any. If you need to know the size of the union, just use `sizeof`.