Click here to Skip to main content
11,706,803 members (48,610 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: encoding

I need to add some Russian language strings in Notepad++. So I added and encoded those strings to UTF-8. If I see added strings in my application, those are showing as changed strings. If I encoded as ANSI, Russian strings are displaying as junk character.

Please help me.

Thanks in advance.
Posted 29-Apr-12 2:39am
SAKryukov at 29-Apr-12 8:47am
Not clear how did you "added" strings in UTF-8. What is your application and why it uses Notepad++? Did you try to open the file encoded as UTF-8 in Notepad++? Did it work? If it works (I believe it should), your code should also work.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Have a look at the Scintilla Documentation[^].

Scintilla is the editor component of Notepad++, and it looks like utf-8 is the default for GTK+ builds only.

Best regards
Espen Harlinn
SAKryukov at 29-Apr-12 21:56pm
Good point, my 5.
I still think that for Windows UTF-16LE should do the trick.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try UTF-16LE. This is the default encoding used in Windows, when Unicode text is presented in memory.

Please see my comment to the question — you did not provide enough information to be 100% sure on what are you trying to do.

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I would do as SA stated, using UTF-16LE (which in .NET can be obtained simply by System.Text.Encoding.Unicode.

Note that you should set the first 2 bits of the file to FF FE, which is the little-endian byte order mark. It will tell Notepad++ which type of text file it has to deal with.
divirakshana at 30-Apr-12 3:42am
Thanks for the reply.

What is the difference between ANSI and UCS-2 Little Endian? If i use UCS-2 Little Endian instead of ANSI, any problems will come? Because UCS-2 Little Endian is working fine for me.

Please suggest me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 156
1 Sergey Alexandrovich Kryukov 155
2 chainerlt 110
3 ppolymorphe 91
4 Mika Wendelius 70
0 OriginalGriff 9,190
1 Sergey Alexandrovich Kryukov 8,407
2 CPallini 5,189
3 Maciej Los 4,756
4 Mika Wendelius 3,686

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 29 Apr 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100