Change the order of a function in a file

Change to the same order as other files.
Merge Ruby r17765 partly
Merge Ruby r30943

Show encoding of compiling regexp.