An error occurs when copying and pasting blender's clipboard to the Text editor under windows I run this piece of code on a Mac and it can run normally, but when it comes to windows, there are two errors
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf7 in position 12: invalid start byte

TypeError: Text.write(): error with argument 1, &quot;text&quot; -  Function.text expected a string type, not bytes

I also print the type of bpy.context.window_manager.clipboard in the python console is str but I don't know why this problem occurs
my code
win = bpy.context.window_manager.windows[0]
    area = win.screen.areas[0]
    area_type = area.type
    area.type = 'INFO'
    override = bpy.context.copy()
    override['window'] = win
    override['screen'] = win.screen
    override['area'] = win.screen.areas[0]
    bpy.ops.info.select_all(override, action='SELECT')
    bpy.ops.info.report_copy(override)
    area.type = area_type
    clipboard = bpy.context.window_manager.clipboard
    bpy.data.texts.new('Recent Reports')
    bpy.data.texts['Recent Reports'].write(clipboard)

A few pieces of code that went wrong:
    clipboard = bpy.context.window_manager.clipboard
    bpy.data.texts.new('Recent Reports')
    bpy.data.texts['Recent Reports'].write(clipboard)```
I now find a solution is to modify the context to get all the information in the prompt,
def get_info_context():
    info_context = None
    for window in bpy.context.window_manager.windows:
        screen = window.screen

        for area in screen.areas:
            if area.type == &quot;INFO&quot;:
                info_context = {&quot;window&quot;: window, &quot;screen&quot;: screen, 'area': area, &quot;regions&quot;: area.regions}

    return info_context

info_context = get_info_context()
bpy.ops.info.select_all(info_context, action='SELECT') 
bpy.ops.info.report_copy(info_context)
bpy.ops.info.select_all(info_context, action='DESELECT')  
clipboard = bpy.context.window_manager.clipboard

So you can get！