Skip to content

Replace UTF-8 currency symbol with ASCII in Statistics visualization#2

Draft
haooo0418 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-statistics-chart-encoding
Draft

Replace UTF-8 currency symbol with ASCII in Statistics visualization#2
haooo0418 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-statistics-chart-encoding

Conversation

Copilot AI commented Nov 8, 2025

Copy link
Copy Markdown

Statistics chart visualization was displaying garbled characters (乱码) in terminals without proper UTF-8 encoding support due to use of the Chinese Yuan symbol ¥ (U+00A5).

Changes

  • src/Visualization.cpp: Replaced ¥ with $ in all currency displays (8 instances across 3 functions)
    • displayTimeBarChart(): income, expense, balance output
    • displayCategoryPieChart(): amount and total output
    • displayAccountBarChart(): income, expense, balance output

This aligns currency symbols across the codebase (main.cpp already uses $) and ensures consistent rendering in all terminal environments.

// Before
std::cout << " ¥" << std::fixed << std::setprecision(2) << stat.income << std::endl;

// After
std::cout << " $" << std::fixed << std::setprecision(2) << stat.income << std::endl;
Original prompt

在我实际测试时,发现Statistics绘制图表的时候出现乱码,请为我修复


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 8, 2025 12:50
Co-authored-by: haooo0418 <170416759+haooo0418@users.noreply.github.com>
Co-authored-by: haooo0418 <170416759+haooo0418@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix encoding issue with statistics chart rendering Replace UTF-8 currency symbol with ASCII in Statistics visualization Nov 8, 2025
Copilot AI requested a review from haooo0418 November 8, 2025 13:00
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.

2 participants