V1.7.3
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
encodingparameter towrite_dofilefunction - Append Encoding: Enhanced
append_dofilefunction 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 = Noneparameter - Defaults to UTF-8 encoding when not specified
- Maintains full backward compatibility with existing workflows
- Added optional
-
append_dofile Enhancement: Improved function with encoding flexibility:
- Added optional
encoding: str = Noneparameter - Consistent encoding handling for both reading and writing operations
- Enhanced parameter documentation with type hints
- Added optional
๐ 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
encodingparameter towrite_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