Weird chinese characters

Hello,

I have a Sieve of Eratosthenes c++ code that is working to show all the prime numbers until n (in an bool array length limit), it's working when I display them in the console but when i try to write them to a text file if n >= first prime number after 1000 then it's showing these weird chinese characters:

′″‵‷ㄱㄠ″㜱ㄠ‹㌲㈠‹ㄳ㌠‷ㄴ㐠″㜴㔠″㤵㘠‱㜶㜠‱㌷㜠‹㌸㠠‹㜹ㄠ㄰

ㄠ㌰ㄠ㜰ㄠ㤰ㄠ㌱ㄠ㜲ㄠㄳㄠ㜳ㄠ㤳ㄠ㤴ㄠㄵㄠ㜵ㄠ㌶ㄠ㜶ㄠ㌷ㄠ㤷

ㄠㄸㄠㄹㄠ㌹ㄠ㜹ㄠ㤹㈠ㄱ㈠㌲㈠㜲㈠㤲㈠㌳㈠㤳㈠ㄴ㈠ㄵ㈠㜵㈠㌶㈠㤶

㈠ㄷ㈠㜷㈠ㄸ㈠㌸㈠㌹㌠㜰㌠ㄱ㌠㌱㌠㜱㌠ㄳ㌠㜳㌠㜴㌠㤴㌠㌵㌠㤵㌠㜶㌠㌷㌠㤷㌠㌸㌠㤸㌠㜹㐠

㄰㐠㤰㐠㤱㐠ㄲ㐠ㄳ㐠㌳㐠㤳㐠㌴㐠㤴㐠㜵㐠ㄶ㐠㌶㐠㜶㐠㤷㐠㜸㐠ㄹ㐠

㤹㔠㌰㔠㤰㔠ㄲ㔠㌲㔠ㄴ㔠㜴㔠㜵㔠㌶㔠㤶㔠ㄷ㔠㜷㔠㜸㔠㌹㔠㤹㘠㄰㘠

㜰㘠㌱㘠㜱㘠㤱㘠ㄳ㘠ㄴ㘠㌴㘠㜴㘠㌵㘠㤵㘠ㄶ㘠㌷㘠㜷㘠㌸㘠ㄹ㜠㄰㜠㤰

㜠㤱㜠㜲㜠㌳㜠㤳㜠㌴㜠ㄵ㜠㜵㜠ㄶ㜠㤶㜠㌷㜠㜸㜠㜹㠠㤰㠠ㄱ㠠ㄲ㠠㌲

㠠㜲㠠㤲㠠㤳㠠㌵㠠㜵㠠㤵㠠㌶㠠㜷㠠ㄸ㠠㌸㠠㜸㤠㜰㤠ㄱ㤠㤱㤠㤲

㤠㜳㤠ㄴ㤠㜴㤠㌵㤠㜶㤠ㄷ㤠㜷㤠㌸㤠ㄹ㤠㜹ㄠ〰‹〱㌱ㄠ㄰‹〱ㄲ਍

If anyone knows what this is and why it is please let me know.
Could you show the code where you write to the file? If the program is short, you can paste it entirely. Just make sure your code is [code]between code tags[/code] so that it has line numbers and syntax highlighting, as well as proper indentation.

Also, what text editor are you using? Some text editors make incorrectly interpret your file if certain special sequences are detected.
Last edited on
Topic archived. No new replies allowed.