mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-18 18:27:55 +08:00
fix remaining missing culture dependent strings #190
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Content;
|
||||
@@ -63,7 +64,10 @@
|
||||
{
|
||||
var stripped = x.Trim();
|
||||
var parts = stripped.Split('|');
|
||||
return (index: int.Parse(parts[0]), letter: parts[1], x: double.Parse(parts[2]), y: double.Parse(parts[3]));
|
||||
var index = int.Parse(parts[0]);
|
||||
var xval = double.Parse(parts[2], CultureInfo.InvariantCulture);
|
||||
var yval = double.Parse(parts[3], CultureInfo.InvariantCulture);
|
||||
return (index, letter: parts[1], x: xval, y: yval);
|
||||
}).ToArray();
|
||||
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
|
@@ -1,7 +1,6 @@
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokens;
|
||||
using Xunit;
|
||||
@@ -18,7 +17,6 @@
|
||||
[InlineData("\0")]
|
||||
public void InvalidFirstCharacter_ReturnsFalse(string s)
|
||||
{
|
||||
var cult = Thread.CurrentThread.CurrentCulture;
|
||||
var input = StringBytesTestConverter.Convert(s);
|
||||
|
||||
var result = tokenizer.TryTokenize(input.First, input.Bytes, out var token);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
namespace UglyToad.PdfPig.Graphics.Operations
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using PdfPig.Core;
|
||||
|
||||
@@ -37,7 +38,7 @@
|
||||
|
||||
public static void WriteDecimal(this Stream stream, decimal value)
|
||||
{
|
||||
stream.WriteText(value.ToString("G"));
|
||||
stream.WriteText(value.ToString("G", CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
public static void WriteNumberText(this Stream stream, decimal number, string text)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
namespace UglyToad.PdfPig.Graphics.Operations.TextState
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Tokens;
|
||||
using Util.JetBrains.Annotations;
|
||||
@@ -64,7 +65,7 @@
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Font} {Size} {Symbol}";
|
||||
return $"{Font} {Size.ToString("G", CultureInfo.InvariantCulture)} {Symbol}";
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Core;
|
||||
using Graphics.Operations;
|
||||
@@ -35,7 +36,7 @@
|
||||
if (catalogReference == null)
|
||||
throw new ArgumentNullException(nameof(catalogReference));
|
||||
|
||||
WriteString($"%PDF-{version:0.0}", Stream);
|
||||
WriteString($"%PDF-{version.ToString("0.0", CultureInfo.InvariantCulture)}", Stream);
|
||||
|
||||
Stream.WriteText("%");
|
||||
Stream.WriteByte(169);
|
||||
|
Reference in New Issue
Block a user