Skip to content

Conversation

saharmor
Copy link

@saharmor saharmor commented Jun 23, 2025

Automated Changes by SimulateDev

Reviewed by a human @saharmor

Setup

Task

Fix UTF-8 encoding issues causing Chinese search queries to display as escape sequences in advanced search mode. Implement proper encoding validation and normalization for API responses.

Coding agents used

  1. cursor with claude-4-sonnet as Planner
  2. cursor with claude-4-sonnet as Coder

Execution time

⏱️ 15m 49.6s


Summary

This PR resolves GitHub Issue #93 where Chinese search queries using search_depth="advanced" in the Tavily Python library returned improperly encoded content. The fix implements UTF-8 validation and normalization in the response processing pipeline to ensure Chinese characters display correctly instead of as escape sequences. The solution specifically targets the advanced search mode where this encoding issue was occurring, adding proper UTF-8 handling without affecting other search functionality.

What changed?

  • Added UTF-8 validation and normalization logic to API response processing
  • Implemented encoding fixes specifically for advanced search mode
  • Updated response handling to prevent Chinese character encoding artifacts
  • Fixed content field display issues for non-ASCII search queries

Review Instructions

Please carefully review all changes before merging. While AI agents are powerful, human oversight is always recommended.


Generated by SimulateDev, the AI coding agents collaboration platform.

- Add UTF-8 validation and normalization for API response content
- Implement proper encoding handling for advanced search mode
- Fix display of Chinese characters in search results content field
- Prevent escape sequence artifacts in non-ASCII text responses

Resolves GitHub Issue tavily-ai#93 where Chinese queries with search_depth="advanced"
returned improperly encoded content displaying as escape sequences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant