projects
/
m17n
/
m17n-lib-cs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b6ad68
)
*** empty log message ***
author
handa
<handa>
Wed, 7 Jan 2009 00:07:57 +0000
(
00:07
+0000)
committer
handa
<handa>
Wed, 7 Jan 2009 00:07:57 +0000
(
00:07
+0000)
MText.cs
patch
|
blob
|
history
temp.cs
patch
|
blob
|
history
diff --git
a/MText.cs
b/MText.cs
index
5d9fbf8
..
7a496a5
100644
(file)
--- a/
MText.cs
+++ b/
MText.cs
@@
-101,6
+101,11
@@
namespace M17N.Core
return mt;
}
return mt;
}
+ public override string ToString ()
+ {
+ return sb.ToString ();
+ }
+
private static bool surrogate_high_p (char c)
{
return (c >= 0xD800 && c < 0xDC00);
private static bool surrogate_high_p (char c)
{
return (c >= 0xD800 && c < 0xDC00);
@@
-183,7
+188,11
@@
namespace M17N.Core
set {
i = pos_to_idx (this, i);
if (value < 0x10000)
set {
i = pos_to_idx (this, i);
if (value < 0x10000)
- sb[i] = (char) value;
+ {
+ if (surrogate_high_p (sb[i]))
+ sb.Remove (i, 1);
+ sb[i] = (char) value;
+ }
else
{
char high = (char) (0xD800 + ((i - 0x10000) >> 10));
else
{
char high = (char) (0xD800 + ((i - 0x10000) >> 10));
diff --git
a/temp.cs
b/temp.cs
index
c110b7e
..
ae5d9e2
100644
(file)
--- a/
temp.cs
+++ b/
temp.cs
@@
-11,5
+11,10
@@
public class Test
Console.WriteLine (mt[1]);
Console.WriteLine (mt[2]);
Console.WriteLine (mt[3]);
Console.WriteLine (mt[1]);
Console.WriteLine (mt[2]);
Console.WriteLine (mt[3]);
+ Console.WriteLine (mt + new MText ("漢字"));
+ mt[1] = 'b';
+ Console.WriteLine (mt);
+ mt[1] = 0x1d100;
+ Console.WriteLine (mt);
}
}
}
}