Skip to content

[BUG] Error executing tool write_note: 'gbk' codec can't decode byte #86

@vivian27

Description

@vivian27

Bug Description

While attempting to write a note using the write_note function, I encountered an encoding error related to the 'gbk' codec. The error message is as follows:

'gbk' codec can't decode byte 0xa1 in position 22: illegal multibyte sequence

Steps To Reproduce

Steps to reproduce the behavior:

  1. Attempt to write a note containing non-ASCII characters using the write_note function.
  2. Observe the encoding error related to the 'gbk' codec.
  3. but the markdown files had been genarate successful

Expected Behavior

The function should successfully write notes containing non-ASCII characters without encountering encoding errors.

Actual Behavior

{ "params": { "title": "减重方案", "content": "### 个人信息\n- **性别**: 男性\n- **年龄**: 约31岁\n- **身高**: 173 cm\n- **当前体重**: 76-77 kg\n- **目标体重**: 70 kg\n- **日常活动水平**: 轻度活动(办公室工作)\n- **当前锻炼习惯**: 无\n\n### 减重方案\n\n#### 每日热量摄入建议\n为了实现健康减重,建议每日摄入的热量应低于您的基础代谢率(BMR)加上日常活动消耗的热量。一般来说,每日减少500-1000卡路里可以每周减重约0.5-1公斤。\n\n1. **计算基础代谢率(BMR)**:\n - 使用Mifflin-St Jeor公式计算:\n \\[\n BMR = 10 \\times \\text{体重(kg)} + 6.25 \\times \\text{身高(cm)} - 5 \\times \\text{年龄} + 5\n \\]\n - 代入您的数据:\n \\[\n BMR = 10 \\times 76.5 + 6.25 \\times 173 - 5 \\times 31 + 5 = 1681 \\text{卡路里/天}\n \\]\n\n2. **计算每日总消耗(TDEE)**:\n - 由于您的活动水平为轻度活动,TDEE约为BMR的1.375倍。\n \\[\n TDEE = 1681 \\times 1.375 = 2310 \\text{卡路里/天}\n \\]\n\n3. **每日热量摄入目标**:\n - 为了减重,每日摄入应低于TDEE。建议每日摄入约1800-2000卡路里。\n\n#### 运动建议\n- **开始锻炼**: 每周进行至少150分钟的中等强度有氧运动(如快走、慢跑、骑自行车)。\n- **力量训练**: 每周至少进行2次全身力量训练,以帮助提高基础代谢率。\n\n#### 饮食建议\n- **增加蛋白质摄入**: 有助于增加饱腹感和维持肌肉质量。\n- **多吃蔬菜和水果**: 提供必要的维生素和矿物质。\n- **减少糖分和精制碳水化合物**: 控制热量摄入。\n\n### 注意事项\n- **监控进展**: 定期称重并记录饮食和运动情况。\n- **保持水分**: 每天饮用足够的水。\n- **咨询专业人士**: 在开始任何新的饮食或运动计划前,建议咨询医生或营养师。", "folder": "健康计划" }, "response": { "content": [ { "type": "text", "text": "Error executing tool write_note: 'gbk' codec can't decode byte 0xa1 in position 22: illegal multibyte sequence" } ], "isError": true } }

Environment

  • OS: windows
  • Python version: 3.13.2
  • Basic Memory version: 0.12.0
  • Installation method: uv
  • Claude Desktop version (if applicable): I use windsurf

Possible Solution

maybe encoding with utf8 in mcp function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions