diff --git a/source/icu.net.tests/BreakIteratorTests.cs b/source/icu.net.tests/BreakIteratorTests.cs index 4a115d74..f8c6b71d 100644 --- a/source/icu.net.tests/BreakIteratorTests.cs +++ b/source/icu.net.tests/BreakIteratorTests.cs @@ -58,6 +58,17 @@ public void GetBoundaries_Line() Assert.That(parts.ToArray(), Is.EquivalentTo(expected)); } + [Test] + public void GetBoundaries_LocaleDependentBreakPoints_Line() + { + var text = "論‼"; + + var parts = BreakIterator.GetBoundaries(BreakIterator.UBreakIteratorType.LINE, new Locale("ja@lb=loose"), text); + + // we only get 2 boundaries if the ja locale is passed correctly + Assert.That(parts.Count(), Is.EqualTo(2)); + } + [Test] public void GetBoundaries_Sentence() { diff --git a/source/icu.net/NativeMethods/NativeMethods_BreakIterator.cs b/source/icu.net/NativeMethods/NativeMethods_BreakIterator.cs index 515c7bd8..d5faa0f1 100644 --- a/source/icu.net/NativeMethods/NativeMethods_BreakIterator.cs +++ b/source/icu.net/NativeMethods/NativeMethods_BreakIterator.cs @@ -12,7 +12,7 @@ private class BreakIteratorMethodsContainer { [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Unicode)] internal delegate IntPtr ubrk_openDelegate(BreakIterator.UBreakIteratorType type, - string locale, string text, int textLength, out ErrorCode errorCode); + [MarshalAs(UnmanagedType.LPStr)] string locale, string text, int textLength, out ErrorCode errorCode); [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Unicode)] internal delegate IntPtr ubrk_openRulesDelegate(string rules, int rulesLength,