Conversely, if a boy does not know what he wants to do, he is likely to go for CS, because that is the "usual" decision.
Not every boy who went to study CS was dreaming in code since elementary school. Most of them learned to code in college. However, CS girls I knew usually picked it up because they really wanted to do it.
Edit: do I really have to put "on average" every time I use the words "boys" and "girls"?
Please stop encouraging this lie. I've never been encouraged to go into tech, and I'd venture a guess that most people here weren't either. As a matter of fact, for me it was quite the opposite, because every time I was fiddling with a computer, I was told to "stop playing games" and do something "worthwhile".
Now, there's almost certainly nothing inherent about women and men that means they have to think that way, but no-one seems to really be interested in changing this; even groups pushing for more women in tech think this way.
Of course women can be just as good as men, but there is an inherit risk of not being good at the job even after putting in the effort (for both genders). Perhaps women are generally less willing to take that risk and opt for careers that are more welcoming to varying skill levels?
In turn, as they see the massive proliferation of computing, they tend to look at it from a superficial perspective: "Children playing their silly computer games and not getting out, as was back in my day." No matter how much you debunk their arguments, the inertia still sticks and you're often perceived as socially challenged.
So no, boys are not necessarily encouraged to go into tech. Some are, surely. Often for monetary motivations. But a lot are guided by their own passion without outside encouragement, excluding their online peers with likeminded interests.
This indicates that women want to take computer science and engineering to a lesser degree than the other physical sciences. And it appears to be a matter of choice.