Definitions

wéi
variant of 為|为[wei2] as (i.e. in the capacity of) to take sth as to act as to serve as to behave as to become to be to do

wèi
variant of 為|为[wei4], because of for to