In the Sakura editor, you can have a .txt file with UTF-8 encoding, which contains 2 characters that are not available in EUC charset.

When I saved a .txt from UTF-8 to EUC in the editor, it all works well and all characters are displayed properly.

Does anybody know what logic the editor is using to accomplish this?

link|improve this question
I'm not following your question fully. What are your 2 characters which "are not available in EUC"? The source for this app is available here: sakura-editor.svn.sourceforge.net/viewvc/sakura-editor/sakura/…. I'm sure charcode.cpp/.h have what you're after. You can probably get the functionality you want from libiconv too. – Mark H Jul 16 '10 at 12:08
feedback

migrated from stackoverflow.com Jul 16 '10 at 12:56

This question came from our site for professional and enthusiast programmers.

2 Answers

Yes , you are right.. I have seen charcode.cpp ..but its really difficult to understand the logic.. you can take any char which is not available in EUC charset ... what is libiconv?

link|improve this answer
Please associate your accounts at superuser.com/users/43154?tab=accounts (which should have been automatic if you used the same OpenID or maybe even when using the same email address). That will make you the owner of your question again. And then you can comment, instead of posting "answers" that are not answers. Finally, please click the "delete" link underneath this very post/answer. Thanks! (Don't forget superuser.com/faq if you haven't already.) Enjoy! – Arjan Jul 17 '10 at 14:42
feedback

which contains 2 characters which are not available in EUC charset

If you are seeing two characters ÿþ (hex FF FE) or þÿ (hex FE FF) at the beginning of the first line, then the file is encoded in UTF-16, not UTF-8. These characters are then actually the "byte-order mark" (BOM), which the editor should interpret, not show.

(Just in case you see three characters , being hex EF BB BF, at the start of the first line, then that is the BOM for UTF-8. If you are seeing other characters, or not at the start of the first line, can you please edit your question to add some example?)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown