Filehelpers library cannot read ™ characterBest way to repeat a character in C#Reading settings from app.config or web.config in .netWhat's the difference between code page and character encoding?Using FileHelpers without a typeFileHelpers Read Int “NA”FileHelpers without a typeText File with Fixed WidthFilehelper not capturing all errors in each rowFilehelper differenciate errors based on Exception Message and manipulate record stringWhy should I mark the last column of class model as optional when importing a CSV file with FileHelpers?
Identification of vintage sloping window
Should I ask for permission to write an expository post about someone's else research?
Is Texas Instrument wrong with their pin number on TO-92 package?
Generating function of ordered partitions
Christian apologetics regarding the killing of innocent children during the Genesis flood
What is my malfunctioning AI harvesting from humans?
(11 of 11: Meta) What is Pyramid Cult's All-Time Favorite?
In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?
How are you supposed to know the strumming pattern for a song from the "chord sheet music"?
Can a fight scene, component-wise, be too complex and complicated?
Tikzpicture - finish drawing a curved line for a cake slice
Why is transplanting a specific intact brain impossible if it is generally possible?
Help evaluating integral (anything simple that I am missing?)
Blocking people from taking pictures of me with smartphone
Word or idiom defining something barely functional
changing number of arguments to a function in secondary evaluation
What does Apple mean by "This may decrease battery life"?
How many different ways are there to checkmate in the early game?
how to differentiate when a child lwc component is called twice in parent component?
Which I-94 date do I believe?
What costs less energy? Roll or Yaw?
Generate Brainfuck for the numbers 1–255
Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?
Acceptable to cut steak before searing?
Filehelpers library cannot read ™ character
Best way to repeat a character in C#Reading settings from app.config or web.config in .netWhat's the difference between code page and character encoding?Using FileHelpers without a typeFileHelpers Read Int “NA”FileHelpers without a typeText File with Fixed WidthFilehelper not capturing all errors in each rowFilehelper differenciate errors based on Exception Message and manipulate record stringWhy should I mark the last column of class model as optional when importing a CSV file with FileHelpers?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using Filehelpers.Net library and I have a CSV file that I am trying to read.
One of the columns has the character ™.
I am getting an error
Line: 1054 Column: 357. No value found for the value type field:
'Comment' Class: 'ClientOrders'. You must use the [FieldNullValue]
attribute because this is a value type and can't be null or use a
Nullable Type instead of the current type.
I have opened the file in Notepad++ and I can see that this invalid character is at the position the error gives.
How do I force Filehelpers to read this character?
Update:
This is my code
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var engine = new FileHelperEngine<ClientOrders>(utf8);
ClientOrders[] fileResult = engine.ReadFile(csvFile.FullName);
c# .net filehelpers
|
show 3 more comments
I am using Filehelpers.Net library and I have a CSV file that I am trying to read.
One of the columns has the character ™.
I am getting an error
Line: 1054 Column: 357. No value found for the value type field:
'Comment' Class: 'ClientOrders'. You must use the [FieldNullValue]
attribute because this is a value type and can't be null or use a
Nullable Type instead of the current type.
I have opened the file in Notepad++ and I can see that this invalid character is at the position the error gives.
How do I force Filehelpers to read this character?
Update:
This is my code
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var engine = new FileHelperEngine<ClientOrders>(utf8);
ClientOrders[] fileResult = engine.ReadFile(csvFile.FullName);
c# .net filehelpers
Can you share your code?
– bdn02
Mar 27 at 8:26
Does the "read" / "open" / whatever method that you're using take anEncodingobject by any chance? Are you passing the right one?
– Marc Gravell♦
Mar 27 at 8:27
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:EF BB BF. If not then it could be using a different encoding.
– Peter B
Mar 27 at 8:40
|
show 3 more comments
I am using Filehelpers.Net library and I have a CSV file that I am trying to read.
One of the columns has the character ™.
I am getting an error
Line: 1054 Column: 357. No value found for the value type field:
'Comment' Class: 'ClientOrders'. You must use the [FieldNullValue]
attribute because this is a value type and can't be null or use a
Nullable Type instead of the current type.
I have opened the file in Notepad++ and I can see that this invalid character is at the position the error gives.
How do I force Filehelpers to read this character?
Update:
This is my code
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var engine = new FileHelperEngine<ClientOrders>(utf8);
ClientOrders[] fileResult = engine.ReadFile(csvFile.FullName);
c# .net filehelpers
I am using Filehelpers.Net library and I have a CSV file that I am trying to read.
One of the columns has the character ™.
I am getting an error
Line: 1054 Column: 357. No value found for the value type field:
'Comment' Class: 'ClientOrders'. You must use the [FieldNullValue]
attribute because this is a value type and can't be null or use a
Nullable Type instead of the current type.
I have opened the file in Notepad++ and I can see that this invalid character is at the position the error gives.
How do I force Filehelpers to read this character?
Update:
This is my code
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var engine = new FileHelperEngine<ClientOrders>(utf8);
ClientOrders[] fileResult = engine.ReadFile(csvFile.FullName);
c# .net filehelpers
c# .net filehelpers
edited Mar 27 at 8:52
Aarif
6227 silver badges18 bronze badges
6227 silver badges18 bronze badges
asked Mar 27 at 8:22
pantonispantonis
8262 gold badges13 silver badges33 bronze badges
8262 gold badges13 silver badges33 bronze badges
Can you share your code?
– bdn02
Mar 27 at 8:26
Does the "read" / "open" / whatever method that you're using take anEncodingobject by any chance? Are you passing the right one?
– Marc Gravell♦
Mar 27 at 8:27
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:EF BB BF. If not then it could be using a different encoding.
– Peter B
Mar 27 at 8:40
|
show 3 more comments
Can you share your code?
– bdn02
Mar 27 at 8:26
Does the "read" / "open" / whatever method that you're using take anEncodingobject by any chance? Are you passing the right one?
– Marc Gravell♦
Mar 27 at 8:27
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:EF BB BF. If not then it could be using a different encoding.
– Peter B
Mar 27 at 8:40
Can you share your code?
– bdn02
Mar 27 at 8:26
Can you share your code?
– bdn02
Mar 27 at 8:26
Does the "read" / "open" / whatever method that you're using take an
Encoding object by any chance? Are you passing the right one?– Marc Gravell♦
Mar 27 at 8:27
Does the "read" / "open" / whatever method that you're using take an
Encoding object by any chance? Are you passing the right one?– Marc Gravell♦
Mar 27 at 8:27
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:
EF BB BF. If not then it could be using a different encoding.– Peter B
Mar 27 at 8:40
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:
EF BB BF. If not then it could be using a different encoding.– Peter B
Mar 27 at 8:40
|
show 3 more comments
1 Answer
1
active
oldest
votes
Have you set the correct Encoding? I guess you want to set the encoding:
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var helper = new FileHelperEngine(recordType, utf8);
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
You need to replaceUTF8Encodingwith the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding
– shamp00
Mar 27 at 9:04
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372624%2ffilehelpers-library-cannot-read-character%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you set the correct Encoding? I guess you want to set the encoding:
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var helper = new FileHelperEngine(recordType, utf8);
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
You need to replaceUTF8Encodingwith the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding
– shamp00
Mar 27 at 9:04
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
add a comment |
Have you set the correct Encoding? I guess you want to set the encoding:
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var helper = new FileHelperEngine(recordType, utf8);
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
You need to replaceUTF8Encodingwith the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding
– shamp00
Mar 27 at 9:04
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
add a comment |
Have you set the correct Encoding? I guess you want to set the encoding:
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var helper = new FileHelperEngine(recordType, utf8);
Have you set the correct Encoding? I guess you want to set the encoding:
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
var helper = new FileHelperEngine(recordType, utf8);
answered Mar 27 at 8:29
S.SpiekerS.Spieker
4,2996 gold badges31 silver badges44 bronze badges
4,2996 gold badges31 silver badges44 bronze badges
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
You need to replaceUTF8Encodingwith the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding
– shamp00
Mar 27 at 9:04
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
add a comment |
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
You need to replaceUTF8Encodingwith the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding
– shamp00
Mar 27 at 9:04
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
I have added what you suggested. Same result. I also have edited my original post and added the code
– pantonis
Mar 27 at 8:34
1
1
You need to replace
UTF8Encoding with the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding– shamp00
Mar 27 at 9:04
You need to replace
UTF8Encoding with the same encoding as your file. You can determine the file's encoding by opening it with Visual Studio, then File -> Save As..., you click the small down arrow on the Save button, and there is an option to Save With Encoding that will indicate the current encoding– shamp00
Mar 27 at 9:04
1
1
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
@shamp00 It will indicate the guess that Visual Studio made, it is not necessarily correct.
– Lasse Vågsæther Karlsen
Mar 27 at 9:25
1
1
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
@shamp00 you were correct file encoding was different.
– pantonis
Apr 1 at 11:37
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372624%2ffilehelpers-library-cannot-read-character%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share your code?
– bdn02
Mar 27 at 8:26
Does the "read" / "open" / whatever method that you're using take an
Encodingobject by any chance? Are you passing the right one?– Marc Gravell♦
Mar 27 at 8:27
I have edited my original post and added the code
– pantonis
Mar 27 at 8:35
And how certain are you that it actually is a UTF-8 file? If you open the file in a binary editor to show the exact bytes, what bytes are present at that point in the file?
– Jon Skeet
Mar 27 at 8:36
Make sure that the file you are reading actually starts with the UTF8 BOM, which consists of these three hex bytes:
EF BB BF. If not then it could be using a different encoding.– Peter B
Mar 27 at 8:40