Here is a couple of pics of the ball socket I just soldered on to a Lokar cable.
I have two kinds of M8 ball sockets, one has a external spring, the other internal. Your choice. I might be tempted to use the external spring as it easier to get the ball on the pedal stud, then apply the spring.
Either way, cut the base length down to minimize ball length. I left .375-ish I think.
The apply solder to the bare clean wire end. I use standard electronic resin core solder. I've also used a silver bearing solder. The trick is two parts. First, used a solder flux paste. Second, use a soldering iron, not a flame. The flame creates too much oxidation and the solder will never "take". Still this step seems tough to get to work all the time. Lots of paste, hot iron, apply solder fast and plentiful and pray to an appropriate deity I suppose.
Now put the ball socket in a vice and use a small flame torch to heat and fill the void with solder. Flame is fine here, the steel soaks this stuff up.
Now get the tinned cable end, and flame melt the solder in the ball socket, stick the wire in to the bottom. Keep the heat on for a few seconds so the solder in the wire melts.
Remove the heat and hold the wire steady and in the middle until it solidifies. Done!
I have tested this with a vice grip on the ball socket and wire held in the vise and I cannot separate them except if I then pound on the vise grip with a alb hammer. The cable breaks before the cable is pulled out the solder. I have many many miles on mine and other Datsun's 'round here with this setup. About all that can go wrong is if the cable at either end rubs the centre inside lining and gets key seated. Make SURE the cable enters and exits in a straight line. Bend the top of the pedal to ensure alignment if necessary. Some silicon lube of your choice is like a good idea too.