Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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
add comment

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

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

1 Answer

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?)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.