digitalmars.D - utf-8?
- Steve Teale (7/7) Mar 17 2009 import std.stdio;
- Ary Borenszweig (2/11) Mar 17 2009 Did you save the file as UTF-8?
- Trass3r (2/6) Mar 17 2009 Yeah, you must save the file as UTF-8.
- Steve Teale (2/14) Mar 17 2009 Was not offered the opportunity. I pasted the text from the web page int...
- Ary Borenszweig (3/18) Mar 17 2009 Notepad will do the trick, but you must save it as UTF-8. In the Save As...
- Walter Bright (6/9) Mar 17 2009 The huge problem with code pages is, given a file with some text in it,
- Georg Wrede (3/13) Mar 17 2009 I pasted your code above and compiled and ran it with no problem.
- Gide Nwawudu (12/19) Mar 17 2009 Works for me, you should save the file as UTF-8 and set your codepage
- Denis Koroskin (2/24) Mar 17 2009 I believe Phobos should do it manually.
- Steve Teale (2/29) Mar 18 2009 Yup, that does it. I'd missed the encoding option in notepad. What were ...
- Daniel Keep (5/35) Mar 18 2009 You have to configure CMD to use Lucida Console as the font. Also note
import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?
Mar 17 2009
Steve Teale wrote:import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Did you save the file as UTF-8?
Mar 17 2009
Ary Borenszweig schrieb:Yeah, you must save the file as UTF-8.Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Did you save the file as UTF-8?
Mar 17 2009
Ary Borenszweig Wrote:Steve Teale wrote:Was not offered the opportunity. I pasted the text from the web page into Windows Notepad, and saved it - this seemed to me to be as generic as possible given the facilities I have available. What editor will do the trick? Also, if I'm using the Windows version of the compiler, shouldn't it be smart enough to convert the Windows character set to UTF-8?import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Did you save the file as UTF-8?
Mar 17 2009
Steve Teale wrote:Ary Borenszweig Wrote:Notepad will do the trick, but you must save it as UTF-8. In the Save As dialog select UTF-8 in Encoding.Steve Teale wrote:Was not offered the opportunity. I pasted the text from the web page into Windows Notepad, and saved it - this seemed to me to be as generic as possible given the facilities I have available. What editor will do the trick? Also, if I'm using the Windows version of the compiler, shouldn't it be smart enough to convert the Windows character set to UTF-8?import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Did you save the file as UTF-8?
Mar 17 2009
Steve Teale wrote:Also, if I'm using the Windows version of the compiler, shouldn't it be smart enough to convert the Windows character set to UTF-8?The huge problem with code pages is, given a file with some text in it, there is NO CLUE what code page the file's text encoding is in. Just because dmd is running on Windows is not any reason at all that the character set of the file must be the Windows character set. I ran into this problem all the time with C code.
Mar 17 2009
Steve Teale wrote:import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?I pasted your code above and compiled and ran it with no problem. I'm on linux: Fedora 10, and dmd v2.026.
Mar 17 2009
On Tue, 17 Mar 2009 10:48:56 -0400, Steve Teale <steve.teale britseyeview.com> wrote:import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Works for me, you should save the file as UTF-8 and set your codepage to 65001. C:\> dmd test.d C:\> test Die Walk+?re C:\>chcp 65001 Active code page: 65001 C:\>test Die Walküre Gide
Mar 17 2009
On Wed, 18 Mar 2009 02:34:49 +0300, Gide Nwawudu <gide btinternet.com> wrote:On Tue, 17 Mar 2009 10:48:56 -0400, Steve Teale <steve.teale britseyeview.com> wrote:I believe Phobos should do it manually.import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Works for me, you should save the file as UTF-8 and set your codepage to 65001. C:\> dmd test.d C:\> test Die Walk+?re C:\>chcp 65001 Active code page: 65001 C:\>test Die Walküre Gide
Mar 17 2009
Gide Nwawudu Wrote:On Tue, 17 Mar 2009 10:48:56 -0400, Steve Teale <steve.teale britseyeview.com> wrote:Yup, that does it. I'd missed the encoding option in notepad. What were you running the program in - in a cmd window I see graphics characters.import std.stdio; void main() { string s = "Die Walküre"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Works for me, you should save the file as UTF-8 and set your codepage to 65001. C:\> dmd test.d C:\> test Die Walk+?re C:\>chcp 65001 Active code page: 65001 C:\>test Die Walküre Gide
Mar 18 2009
Steve Teale wrote:Gide Nwawudu Wrote:You have to configure CMD to use Lucida Console as the font. Also note that CMD won't do fallbacks like virtually every other Windows app: if a character isn't in Lucida Console, you won't see it. -- DanielOn Tue, 17 Mar 2009 10:48:56 -0400, Steve Teale <steve.teale britseyeview.com> wrote:Yup, that does it. I'd missed the encoding option in notepad. What were you running the program in - in a cmd window I see graphics characters.import std.stdio; void main() { string s = "Die Walk�re"; writefln(s); } Gives error - invalid utf-8 sequence. I pasted the text from a Wiki page that claims to be utf-8. What's happening?Works for me, you should save the file as UTF-8 and set your codepage to 65001. C:\> dmd test.d C:\> test Die Walk+?re C:\>chcp 65001 Active code page: 65001 C:\>test Die Walk�re Gide
Mar 18 2009