Skip to content

V1.7.3

Choose a tag to compare

@SepineTam SepineTam released this 06 Oct 15:32
· 655 commits to master since this release

Stata-MCP v1.7.3 Release Notes

Release Date: October 6, 2025
Version: 1.7.3
License: Apache License 2.0

๐Ÿš€ Overview

Stata-MCP version 1.7.3 introduces enhanced encoding flexibility for dofile operations to better support international character sets. This release adds configurable encoding parameters to write_dofile and append_dofile functions, proactively addressing potential character encoding issues including those mentioned in GitHub issue #18.

โœจ New Features

๐Ÿ”ค Enhanced Dofile Encoding Support

  • Configurable Encoding: Added optional encoding parameter to write_dofile function
  • Append Encoding: Enhanced append_dofile function with configurable encoding support
  • Backward Compatibility: All existing code continues to work with default UTF-8 encoding
  • International Character Support: Better support for Chinese, Japanese, Korean, and other international character sets in Stata dofiles

โœจ Changes

๐Ÿ”ง Core Functionality Improvements

  • write_dofile Enhancement: Updated function signature and implementation:

    • Added optional encoding: str = None parameter
    • Defaults to UTF-8 encoding when not specified
    • Maintains full backward compatibility with existing workflows
  • append_dofile Enhancement: Improved function with encoding flexibility:

    • Added optional encoding: str = None parameter
    • Consistent encoding handling for both reading and writing operations
    • Enhanced parameter documentation with type hints

๐Ÿ›  Technical Details

  • Issue #18 Reference: Proactive implementation to address encoding concerns raised in GitHub issue #18 regarding Chinese character support
  • No Breaking Changes: All enhancements maintain full backward compatibility
  • Default Behavior: UTF-8 encoding used when no encoding is specified
  • Cross-Platform: Enhanced encoding support works across macOS, Windows, and Linux

๐ŸŽฏ Issue Resolution

โœ… GitHub Issue #18 - Chinese Character Encoding Support

Issue: Chinese Character Encoding Issues
Status: โœ… RESOLVED

Problem Description: Users encountered encoding issues when working with Chinese characters in Stata dofiles, including:

  • Chinese variable names not being properly handled in dofile creation
  • Character encoding corruption in file operations
  • Limited support for international character sets

Solution Implemented:

  • Added configurable encoding parameter to write_dofile() function
  • Enhanced append_dofile() with consistent encoding support
  • Maintained UTF-8 as default while supporting various encodings (GBK, Latin1, etc.)
  • Ensured full backward compatibility with existing code

Impact: This fix enables Stata-MCP to better support international users working with non-English character sets, particularly Chinese users who need to process datasets with Chinese variable names and annotations.

๐Ÿ“‹ Compatibility

โœ… Supported Environments

  • Operating Systems: macOS, Windows, Linux
  • Python Versions: Python >= 3.11
  • Stata Versions: All modern Stata editions (MP, SE, IC)
  • Character Encodings: UTF-8, Latin1, GBK, and other common encodings

๐Ÿ”„ Upgrade Benefits

  • Enhanced International Support: Better handling of non-English characters in Stata code
  • Future-Proofing: Proactive encoding improvements for global user base
  • Seamless Transition: No configuration changes required for existing users
  • Flexible Workflows: Support for various encoding requirements in different environments

๐Ÿ› Bug Fixes

  • Encoding Flexibility: Addressed potential encoding problems with international character sets in dofiles
  • Character Set Support: Improved support for Stata code containing Chinese and other international characters

๐Ÿ“ˆ Performance

  • Maintained Performance: No performance impact on existing functionality
  • Enhanced Reliability: Better error handling for encoding-related edge cases
  • Memory Efficiency: Optimal memory usage maintained while supporting multiple encodings

๐Ÿš€ Quick Start

Using Enhanced Encoding Features

# Write dofile with custom encoding
write_dofile(stata_code, encoding="gbk")      # For Chinese environments
write_dofile(stata_code, encoding="latin1")   # For Western European characters

# Append to dofile with specific encoding
append_dofile(existing_file, new_code, encoding="utf-8")

Default Behavior (Unchanged)

# Uses UTF-8 encoding by default
write_dofile(stata_code)
append_dofile(existing_file, new_code)

๐Ÿ”ฎ Future Directions

  • Continued monitoring of encoding-related user feedback
  • Potential enhancements based on international user requirements
  • Improved documentation for encoding best practices
  • Enhanced support for additional character encodings as needed

Download: stata-mcp v1.7.3
PyPI: stata-mcp on PyPI