convert string to lower in get_enum_val as needed
Always use cached 4k string buf if output size < 4k
Fix code style